我的应用程序显示第二次通知的iOS 9 [英] does my app display second time notification iOS 9

查看:206
本文介绍了我的应用程序显示第二次通知的iOS 9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到重复的通知。为远程通知和本地通知。

I am receiving the duplicate Notification. for both Remote notification and Local notifications.

我用下面的code

[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一个错误的地方。我注意到,我的应用程序的大部分重复发送通知。计算器的iOS应用,苹果的iTunes应用程序连接和其他几个人。 pretty确保其同样的问题,你遇到。也许文件与苹果雷达。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆