iOS 8因为改变了推送消息的注册方式,所以在有推送需求的应用开发时,需要有些与以前不同的修改。然后可以试试在appDelegate.m文件的didFinishLaunchingWithOptions方法中加入下面一段代码以避免在iPhone 6/6 Plus上出现问题:
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
[[UIApplication sharedApplication] registerForRemoteNotifications];
} else {
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound];
}
}