我的应用程序是否显示第二次通知 iOS 9 [英] does my app display second time notification iOS 9
本文介绍了我的应用程序是否显示第二次通知 iOS 9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到了重复的通知.用于远程通知和本地通知.
I am receiving the duplicate Notification. for both Remote notification and Local notifications.
我使用了以下代码
[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);}
我一直收到重复的推送通知.
i am Receiving Duplicate push notifications all the time.
推荐答案
我认为这是 iOS9 上某个地方的错误.我注意到我的应用程序中有很大一部分会发送重复的通知.StackoverFlow 的 iOS 应用程序、Apple 的、iTunes Connect 应用程序和其他一些应用程序.很确定它与您遇到的问题相同.也许向 Apple 提交雷达报告.
I think this is a bug on iOS9 somewhere. I have noticed that a large percentage of my app send duplicate notifications. StackoverFlow's iOS app, Apple's, iTunes Connect app and a few others. Pretty sure its the same issue you're having. Maybe file a radar with Apple.
这篇关于我的应用程序是否显示第二次通知 iOS 9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文