推送。<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];
}
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];
}
相关文章推荐
- ios block1
- iOS开发学习路径的一些建议
- Missing iOS Distribution signing identity for...
- iOS警告收录及科学快速的消除方法
- iOS 从Xcode看应用支持横竖屏
- iOS通知
- NSMutableArray 简介
- iOS项目接入高德skd
- iOS--kxmovie之FFmpeg编译和使用
- CYC-CocoaPods
- IOS自定义图片放右边的Button
- iOS 离屏渲染
- IOS 如何选择delegate、notification、KVO?
- iOS Blog
- iOS字体相关知识
- 高仿ios SwitchButton----(自认为仿的还不错)
- IOS设计模式之一(MVC模式,单例模式)
- IOS Xcode开发中的文件后缀名区别m,mm,cpp,h
- iOS 沙盒文件操作
- 超全!整理常用的iOS第三方资源(转)