APP 适配 iOS8,位置、通知等特性
来源:互联网 发布:网络用语dm是什么意思 编辑:程序博客网 时间:2024/05/16 09:48
跳转到系统 App 设置
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
位置访问添加 开始-结束 之间代码请求询问
self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.delegate = self; //开始 if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined) { [self.locationManager requestWhenInUseAuthorization]; } //结束 [self.locationManager startUpdatingLocation];
接受推送通知添加如下
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; [[UIApplication sharedApplication] registerForRemoteNotifications]; //或者使用"在 APPDelegate 中对应位置添加" 2选1 } else { //原来注册通知的代码 [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)]; }
在 APPDelegate 中对应位置添加
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings { if (notificationSettings.types != UIUserNotificationTypeNone) { [application registerForRemoteNotifications]; }}
0 0
- APP 适配 iOS8,位置、通知等特性
- APP 适配 iOS8,位置、通知等特性
- (iOS8之后)APP启用位置、通知、联系人、相机、日历以及健康等设置
- IOS8 通知中心(Notification Center)新特性
- IOS8 通知中心(Notification Center)新特性
- iOS8新特性之交互式通知
- iOS8新特性之交互式远程通知
- ios8通知
- iOS8新特性之基于地理位置的消息通知UILocalNotification
- iOS8新特性之基于地理位置的消息通知UILocalNotification
- iOS8新特性之基于地理位置的消息通知UILocalNotification
- ios8新特性widget开发(自定义的通知栏样式)
- ios 跳转系统设置位置、通知等
- 隐私设置跳转(通知,位置等)
- iOS 激活APP时通知APP开始获取用户位置
- IOS8通知栏显示快捷开关蜂窝数据,快捷开关VPN,快捷开关定位位置
- iOS iOS8注册通知
- iOS8 通知的变化
- struts2基础(1)
- 控件字体大小随内容变化而变化
- 基于android 社区app短信分享 发送回调事件实现
- jstl的formatNumber标签的四舍五入问题
- android使用隐藏api的方法(使用被@hide的api)
- APP 适配 iOS8,位置、通知等特性
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- Runtime.getRuntime().exec中命令含有括号问题
- 承志医院管理系统项目解析 门诊收费(七)
- 《大话设计模式》--为别人做稼衣--代理模式<Proxy>(7)
- Linux C调用C++库
- 微信直接打开App
- Documentation/fb/framebuffer.txt 翻译