• iOS应用内跳转系统设置相关界面的方法


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

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

     1 _array = @[
     2                @{@"系统设置":@"prefs:root=INTERNET_TETHERING"},
     3                @{@"WIFI设置":@"prefs:root=WIFI"},
     4                @{@"蓝牙设置":@"prefs:root=Bluetooth"},
     5                @{@"系统通知":@"prefs:root=NOTIFICATIONS_ID"},
     6                @{@"通用设置":@"prefs:root=General"},
     7                @{@"显示设置":@"prefs:root=DISPLAY&BRIGHTNESS"},
     8                @{@"壁纸设置":@"prefs:root=Wallpaper"},
     9                @{@"声音设置":@"prefs:root=Sounds"},
    10                @{@"隐私设置":@"prefs:root=privacy"},
    11                @{@"APP Store":@"prefs:root=STORE"},
    12                @{@"Notes":@"prefs:root=NOTES"},
    13                @{@"Safari":@"prefs:root=Safari"},
    14                @{@"Music":@"prefs:root=MUSIC"},
    15                @{@"photo":@"prefs:root=Photos"}
    16                ];
    17         NSURL * url = [NSURL URLWithString:[_array[index] allValues].firstObject];
    18         [[UIApplication sharedApplication]openURL:url];

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

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

     1 _array = @[
     2                @{@"关于本机":@"prefs:root=General&path=About"},
     3                @{@"软件升级":@"prefs:root=General&path=SOFTWARE_UPDATE_LINK"},
     4                @{@"日期时间":@"prefs:root=General&path=DATE_AND_TIME"},
     5                @{@"Accessibility":@"prefs:root=General&path=ACCESSIBILITY"},
     6                @{@"键盘设置":@"prefs:root=General&path=Keyboard"},
     7                @{@"VPN":@"prefs:root=General&path=VPN"},
     8                @{@"壁纸设置":@"prefs:root=Wallpaper"},
     9                @{@"声音设置":@"prefs:root=Sounds"},
    10                @{@"隐私设置":@"prefs:root=privacy"},
    11                @{@"APP Store":@"prefs:root=STORE"},
    12                @{@"还原设置":@"prefs:root=General&path=Reset"},
    13                @{@"应用通知":@"prefs:root=NOTIFICATIONS_ID&path=应用的boundleId"}
    14                ];
  • 相关阅读:
    oracle11g新建表空间和用户
    ORACLE查询数据中所存在的表,搜索指定的表
    QTP的那些事vbs通用操作数据库函数整理
    Oracle:PL/SQL 中如何使用Array
    QTP的那些事—QTP11+QC11框架整理源码(个人原创)
    QTP的那些事灵活运用其中的datatable对象
    QTP的那些事共享对象库的使用
    zoj 1092 Arbitrage (poj 2240)
    zoj 1655 Transport Goods
    UVA 11292 Dragon of Loowater
  • 原文地址:https://www.cnblogs.com/zhizunbao/p/5546274.html
Copyright © 2020-2023  润新知