registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later
2014-09-30 17:05
429 查看
今天遇到了registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later 这个问题,下面是解决的方法:
//
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:
(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}
//
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:
(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}
相关文章推荐
- iOS 推送问题 registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later
- registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later
- registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later
- registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later
- registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later
- registerForRemoteNotificationTypes: is not supported in iOS 8.0 and
- registerForRemoteNotificationTypes: is not supported in iOS 8.0 and
- iOS iOS8中 问题"registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later" 解决方案
- registerForRemoteNotificationTypes: is not supported in iOS 8.0 and late
- iOS iOS8中 问题"registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later" 解决方式
- iOS iOS8中 问题"registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later" 解决方案
- IOS错误之 ---- registerForRemoteNotificationTypes: is not supported
- iOS: Device token and registerForRemoteNotificationTypes, didReceiveRemoteNotification
- iOS: Device token and registerForRemoteNotificationTypes, didReceiveRemoteNotification
- iOS: Device token and registerForRemoteNotificationTypes, didReceiveRemoteNotification
- Code signing is required for product type Unit Test Bundle in SDK iOS 8.0
- NT_iOS笔记—add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plis
- iOS之Xcode 8.0真机调试运行:This ** is running iOS 10.1.1 (14B100), which may not be supported
- Xcode 8.0 调试运行,This ** is running iOS 10.1.1 (14B100), which may not be supported
- SQL Server error "Xml data type is not supported in distributed queries" and workaround for it