zoukankan      html  css  js  c++  java
  • iOS之应用内跳转系统设置相关界面

    在iOS开发中,有时会有跳转系统设置界面的需求,例如提示用户打开蓝牙或者WIFI,提醒用户打开推送或者位置权限等。在iOS6之后,第三方应用需要跳转系统设置界面,需要在URL type中添加一个prefs值,如下图:

            跳转系统设置根目录中的项目使用如下的方法:

      _array = @[
                   @{@"系统设置":@"prefs:root=INTERNET_TETHERING"},
                   @{@"WIFI设置":@"prefs:root=WIFI"},
                   @{@"蓝牙设置":@"prefs:root=Bluetooth"},
                   @{@"系统通知":@"prefs:root=NOTIFICATIONS_ID"},
                   @{@"通用设置":@"prefs:root=General"},
                   @{@"显示设置":@"prefs:root=DISPLAY&BRIGHTNESS"},
                   @{@"壁纸设置":@"prefs:root=Wallpaper"},
                   @{@"声音设置":@"prefs:root=Sounds"},
                   @{@"隐私设置":@"prefs:root=privacy"},
                   @{@"APP Store":@"prefs:root=STORE"},
                   @{@"Notes":@"prefs:root=NOTES"},
                   @{@"Safari":@"prefs:root=Safari"},
                   @{@"Music":@"prefs:root=MUSIC"},
                   @{@"photo":@"prefs:root=Photos"}
                   ];
            NSURL * url = [NSURL URLWithString:[_array[index] allValues].firstObject];
            [[UIApplication sharedApplication]openURL:url];
    

    如果要跳转第三方应用的设置界面中,使用prefs:root=boundleId的方式,boundleId是第三方应用的boundleId。

            如果需要继续向项目内层进行跳转,可以通过添加path路径的方式,如下:

     _array = @[
                   @{@"关于本机":@"prefs:root=General&path=About"},
                   @{@"软件升级":@"prefs:root=General&path=SOFTWARE_UPDATE_LINK"},
                   @{@"日期时间":@"prefs:root=General&path=DATE_AND_TIME"},
                   @{@"Accessibility":@"prefs:root=General&path=ACCESSIBILITY"},
                   @{@"键盘设置":@"prefs:root=General&path=Keyboard"},
                   @{@"VPN":@"prefs:root=General&path=VPN"},
                   @{@"壁纸设置":@"prefs:root=Wallpaper"},
                   @{@"声音设置":@"prefs:root=Sounds"},
                   @{@"隐私设置":@"prefs:root=privacy"},
                   @{@"APP Store":@"prefs:root=STORE"},
                   @{@"还原设置":@"prefs:root=General&path=Reset"},
                   @{@"应用通知":@"prefs:root=NOTIFICATIONS_ID&path=应用的boundleId"}
                   ];
    
  • 相关阅读:
    JNI概述
    Android shape的使用
    全局对象Application的使用,以及如何在任何地方得到Application全局对象
    EditText中禁止输入中文的方法
    利用Selenium实现图片文件上传的两种方式介绍
    LoadRunner结果分析 – TPS
    详解 Spotlight on MySQL监控MySQL服务器
    Linux 服务器运行健康状况监控利器 Spotlight on Unix 的安装与使用
    资源监控工具Spotlight-使用说明
    RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第七篇【元素定位介绍】
  • 原文地址:https://www.cnblogs.com/zhun/p/5547098.html
Copyright © 2011-2022 走看看