在做Push获取设备device Token是提示如下:
[img]http://dl2.iteye.com/upload/attachment/0105/8142/4e62b49f-804b-3159-bedf-7ad24dd94cef.jpg[/img]
registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.
解决办法:
之前注册启用Push的代码是:
[img]http://dl2.iteye.com/upload/attachment/0105/8144/af48d63a-6d95-3ea1-af04-d583ccdeba63.jpg[/img]
现改为如下:
[img]http://dl2.iteye.com/upload/attachment/0105/8146/3b334443-2c3a-3cbc-8cdf-ffd40f816790.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0105/8142/4e62b49f-804b-3159-bedf-7ad24dd94cef.jpg[/img]
registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.
解决办法:
之前注册启用Push的代码是:
[img]http://dl2.iteye.com/upload/attachment/0105/8144/af48d63a-6d95-3ea1-af04-d583ccdeba63.jpg[/img]
现改为如下:
// IOS8新系统需要使用新的代码咯
if([[[UIDevice currentDevice]systemVersion]floatValue] >=8.0){
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound|UIUserNotificationTypeAlert|UIUserNotificationTypeBadge) categories:nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}else{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge)];
}
[img]http://dl2.iteye.com/upload/attachment/0105/8146/3b334443-2c3a-3cbc-8cdf-ffd40f816790.jpg[/img]