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

    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"}

                   ];

  • 相关阅读:
    2011大纽约区域赛试题 Decoding EDSAC Data 解题报告
    湘大OJ第1484题 Allocation of Memory
    谈谈对js作用域的理解与疑问,请各位指正。
    Closure Linter工具介绍,挺好用的。
    JSTL标签用法
    守柔WORD编程代码集 CHM版
    返回任意输出月的最后一天
    Spring中MultipartHttpServletRequest实现文件上传
    SPringMVC注解驱动 .
    账号正在另一客户端登录 判断方法
  • 原文地址:https://www.cnblogs.com/mingjieLove00/p/5546562.html
Copyright © 2011-2022 走看看