ios 代码跳转 定位设置 系统设置 openURL
此处以QQ软件为例
判断了关闭定位的两种情况。
1.在设置->隐私->定位处关闭的全局定位
2.在设置->QQ->定位处关闭的单个软件的定位功能
下面这片代码判断是上面的哪一种定位
if ([CLLocationManager locationServicesEnabled]) {if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied) {UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"QQ已被禁止使用定位功能" message:@"请在iphone \"设置-QQ-定位服务\" 中允许QQ使用定位服务 " delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"设置", nil];alertView.tag = 999;[alertView show];}}else {if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied) {UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"QQ已被禁止使用定位功能" message:@"请在iphone \"设置-隐私-定位服务\" 中允许QQ使用定位服务 " delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"设置", nil];alertView.tag = 998;[alertView show];}}
根据关闭定位的位置不一样,跳转到不同的页面
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{if (buttonIndex == 1) {if (alertView.tag == 999){//设置-QQ-定位服务NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];if ([[UIApplication sharedApplication] canOpenURL:url]) {[[UIApplication sharedApplication] openURL:url];;}}else if (alertView.tag == 998){//设置-隐私-定位服务(全局定位)NSURL *url = [NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"];if ([[UIApplication sharedApplication] canOpenURL:url]) {[[UIApplication sharedApplication] openURL:url];;}}
}
ios 代码跳转 定位设置 系统设置 openURL相关推荐
- iOS App跳转权限设置
开启照相机 #import <AVFoundation/AVFoundation.h> - (void)getCameraJurisdiction { NSString *mediaTyp ...
- iOS app跳转到设置权限页面
代码很简单,这里就不做说明了 OC: NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; if ([[UIAp ...
- ios wifi 定位_iOS最新跳转手机设置WIFI定位等界面方法适配iOS11
iOS的"人性化"不言而喻,就是访问位置,打开WiFi,,,,都需要得到用户的允许,而有些请款下,用户暂时不想打开这些,甚至手抖选错了关闭,这个时候,就需要你去提醒用户去打开权限, ...
- iOS跳转到各种系统设置界面
定位服务 定位服务有很多APP都有,如果用户关闭了定位,那么,我们在APP里面可以提示用户打开定位服务.点击到设置界面设置,直接跳到定位服务设置界面.代码如下: //定位服务设置界面 NSURL *u ...
- iOS 10 跳转系统设置
苦心人天不负, 为了项目终于把 iOS 10 跳转系统设置的方法给搞定了, 很欣慰. http://www.cnblogs.com/lurenq/p/6189580.html iOS 10 跳转系统设 ...
- ios跳转wifi设置页面
1.首先,需要添加一个URL Schemes 2.跳转自己APP的设置页面: [[UIApplication sharedApplication] openURL:[NSURL URLWithStri ...
- android 强制打开gps定位_Android 6.0动态权限及跳转GPS设置界面的方法
1.动态权限申请 模糊的位置信息android.permission.ACCESS_COARSE_LOCATION权限为例 在AndroidManifest文件中加入权限 然后java代码中动态申请 ...
- iOS 应用内跳转到设置页
我参加了CSDN博客之星的的评选, 请为我投上一票. 我的投票入口 CSDN博客之星我的投票入口 直接点击跳转到系统设置界面, 设置通知定位等等 在操作之前, 你需要info中设置 URLTypes, ...
- 【iOS】跳转App权限设置页面
跳转App设置页的方法 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSetting ...
最新文章
- Nature Genetics:微生物如何适应植物的?
- 产品网络推广方案浅谈网站的相关性对优化的影响!
- JavaWeb:用JDBC操作数据库
- Windows服务器下升级PHP版本的方法
- Kubernetes监控之Heapster源码分析
- confluencejira集成_Jira Service Desk使用教程之如何将Jira Cloud与Confluence集成?
- Constructing the Array CodeForces - 1353D(数据结构+分类+建设性算法)
- Java蓝桥杯02——第二题集锦:生日蜡烛、星期一、方格计数、猴子分香蕉
- BZOJ1876 [SDOI2009]SuperGCD 【高精 + GCD优化】
- java 删除二进制内容_二进制搜索树节点删除不删除替换Java
- IOS学习笔记 ---- 15/09/02
- 新手程序员必读的十本书
- 开源GIS(十八)——分辨率与比例尺
- 每周学一点Egret(17)default.thm.json 文件编译小坑
- dft中X(K)的k的含义
- runtime error python 3.5_Python 3.5 RuntimeError: can't start new thread
- 自动化信任和依赖对航空安全的危害及其改进
- LC.1175. Prime Arrangements
- 著名女程序员---女神程序媛
- 电脑死机故障解决方法全面汇总