iOS8 兼容 请求开启远程推送代码
来源:互联网 发布:软件开发就业情况 编辑:程序博客网 时间:2024/06/05 14:27
//register for push notificationif ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8){ [[UIApplication sharedApplication] registerForRemoteNotifications]; UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert ; UIUserNotificationSettings * setting = [UIUserNotificationSettings settingsForTypes:types categories:nil]; [[UIApplication sharedApplication] registerUserNotificationSettings:setting]; NSLog(@"isIOS8");}else{ [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; NSLog(@"not isIOS8");}BOOL bPushEnable = NO;if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8){ UIUserNotificationSettings * pushSetting = [[UIApplication sharedApplication] currentUserNotificationSettings]; if (pushSetting) { UIUserNotificationType pushType = pushSetting.types; NSLog(@"push type = %d", pushType); if (pushType == UIUserNotificationTypeNone) { bPushEnable = NO; } else { bPushEnable = YES; } }}else{ UIRemoteNotificationType pushType = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; NSLog(@"push type = %d", pushType); if (pushType == UIRemoteNotificationTypeNone) { bPushEnable = NO; } else { bPushEnable = YES; }}//如果不能推送if (bPushEnable == NO){ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[UtilsHelper getLocalizeString:@"text_push_notification_title"] message:[UtilsHelper getLocalizeString:@"text_push_notification_content"] delegate:self cancelButtonTitle:[UtilsHelper getLocalizeString:@"text_yes"] otherButtonTitles:nil, nil]; [alert show];}
0 0
- iOS8 兼容 请求开启远程推送代码
- iOS8 兼容 请求开启远程推送代码
- iOS8 开启定位兼容代码
- ios8 sdk 推送兼容代码 registerForRemoteNotifications
- ios8 远程推送的注册代码
- iOS8远程推送
- ios8远程推送
- iOS8的远程推送
- iOS8下的远程推送
- iOS8 远程推送/用户推送/本地推送/地理位置推送
- iOS本地推送的实现,兼容iOS8
- IOS 推送机制详解,兼容IOS8的推送
- ios8下的远程推送通知
- 在iOS8之后的远程推送写法
- ios远程通知,兼容ios7 ios8
- 远程推送.代码托管
- ios8 推送
- iOS8推送
- P52.32(马克思趣味题。)
- VS2012加载项目失败解决办法
- IOC 之AutoFac攻略
- 递归怎么写
- innodb数据库 OPTIMIZE TABLE 提示Table does not support optimize, doing recreate + analyze instead
- iOS8 兼容 请求开启远程推送代码
- 学习笔记:C程序基础(2)
- FFF
- win7配置域以及lync和outlook的配置
- 在线word文件怎么转换成pdf
- 第一课 | 第四节 | 文本设置
- pythonGUI的使用
- 选择勤哲Excel服务器做企业管理系统ERP的经验之谈
- selenium-grid2 远程并发控制用例执行