ios之應用內跳轉系統設定相關介面

來源:互聯網
上載者:User

標籤:

在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"}               ];

 

ios之應用內跳轉系統設定相關介面

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.