标签:is not supported in 推送 ios8 registerforremotenot
注册方式:
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|
UIRemoteNotificationTypeBadge|
UIRemoteNotificationTypeSound];
}
同理判断消息推送是否打开也有变化
UIRemoteNotificationType types;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
types = [[UIApplication sharedApplication] currentUserNotificationSettings].types;
else
types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
return (types & UIRemoteNotificationTypeAlert);
registerForRemoteNotificationTypes: is not supported in iOS 8.0 and
标签:is not supported in 推送 ios8 registerforremotenot
原文地址:http://blog.csdn.net/cerastes/article/details/39958999