我的应用程序显示第二次通知iOS 9

Vvk*_*Vvk 5 objective-c duplicates apple-push-notifications ios

我收到了重复的通知.用于远程通知和本地通知.

我使用了以下代码

[application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert|UIUserNotificationTypeBadge|UIUserNotificationTypeSound categories:nil]];

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0){
    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
    [[UIApplication sharedApplication] registerForRemoteNotifications];
}
else{
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
     (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}

-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
NSString *strDevicetoken = [[NSString alloc]initWithFormat:@"%@",[[[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]] stringByReplacingOccurrencesOfString:@" " withString:@""]];
NSLog(@"devicetoken = %@",strDevicetoken);}
Run Code Online (Sandbox Code Playgroud)

我一直在接收重复的推送通知.

Rob*_*egg 2

我认为这是 iOS9 上某个地方的错误。我注意到我的应用程序的很大一部分会发送重复的通知。StackoverFlow 的 iOS 应用程序、Apple 的 iTunes Connect 应用程序以及其他一些应用程序。很确定这和你遇到的问题是一样的。或许可以向苹果公司提交雷达报告。