您的位置:首页 > 移动开发 > IOS开发

推送。<ios8 和>8.0的推送

2016-02-18 17:19 489 查看
if([UIDevice
currentDevice].systemVersion.doubleValue<=8.0){



//把udid和bundleid发送给苹果的apns服务器


[application
registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert];


}else{


/**


UIUserNotificationTypeBadge UIUserNotificationTypeSound UIUserNotificationTypeAlert

*/


UIUserNotificationType type=UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert;



UIUserNotificationSettings *set=[UIUserNotificationSettings
settingsForTypes:type categories:nil ];


[application
registerUserNotificationSettings:set];



//主动申请


[application
registerForRemoteNotifications];


}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: