我将Xcode升级到Xcode 6.0.1,现在iOS8设备没有发生远程通知注册。它适用于iOS 7设备。为什么应用程序未在iOS 8中注册推送通知?
我已经加入在应用程序代理的代码如下所述:
//-- Set Notification
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIRemoteNotificationTypeBadge
|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert) categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
NSLog(@"current notifications : %@", [[UIApplication sharedApplication] currentUserNotificationSettings]);
}
else
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}
即使当前通知存在,并且它不是零。
然而下面的方法不叫:下面
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
截图解释说,我已经启用的后台模式的某些选项:
和通知在设备设置我的应用程序的设置。
非常感谢。现在,该应用正在成功注册推送通知。 – user1899840 2014-09-26 08:04:28