1. 程式人生 > >Ios從app中跳到設定相關介面方法

Ios從app中跳到設定相關介面方法

1、從自己的app跳轉到設定中相應的app設定介面
NSURL * url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
if([[UIApplication sharedApplication] canOpenURL:url])
{
NSURL*url =[NSURL URLWithString:UIApplicationOpenSettingsURLString]; 
[[UIApplication sharedApplication] openURL:url];
}

2、從app跳轉到設定介面指定的相應介面
NSURL*url=[NSURL URLWithString:@"prefs:root=WIFI"];

[[UIApplication sharedApplication] openURL:url];
即可跳轉到設定頁面的對應項。
跳轉驗證成功:
設定飛航模式 : prefs:root=AIRPLANE_MODE 
設定->無線區域網:prefs:root=WIFI 
設定->藍芽:prefs:root=Bluetooth 
設定->通用:prefs:root=General 
設定->通用->關於本機:prefs:root=General&path=About 
設定->通用->軟體更新:prefs:root=General&path=SOFTWARE_UPDATE_LINK 

設定->通用->輔助功能:prefs:root=General&path=ACCESSIBILITY 
設定->通用->自動鎖定:prefs:root=General&path=AUTOLOCK 
設定->通用->日期與時間:prefs:root=General&path=DATE_AND_TIME 
設定->通用->鍵盤:prefs:root=General&path=Keyboard 
設定->通用->語言與地區:prefs:root=General&path=INTERNATIONAL 
設定->通用->描述檔案:prefs:root=General&path=ManagedConfigurationList

設定->通用->還原: prefs:root=General&path=Reset
設定->牆紙:prefs:root=Wallpaper
設定->聲音:prefs:root=Sounds
設定->隱私->定位服務:prefs:root=LOCATION_SERVICES
設定->iCloud:prefs:root=CASTLE
設定->iCloud->儲存空間: prefs:root=CASTLE&path=STORAGE_AND_BACKUP
設定->iTunes Store 與 App Store:prefs:root=STORE
設定->備忘錄:prefs:root=NOTES
設定->電話:prefs:root=Phone 
設定->FaceTime:prefs:root=FACETIME 
設定->音樂:prefs:root=MUSIC 
設定->音樂->音量平衡:prefs:root=MUSIC&path=EQ 
設定->音樂->音量限制:prefs:root=MUSIC&path=VolumeLimit
設定->照片與相機:prefs:root=Photos
設定->Twitter:prefs:root=TWITTER
跳轉驗證失敗:
Brightness — prefs:root=Brightness 
Network — prefs:root=General&path=Network
Nike + iPod — prefs:root=NIKE_PLUS_IPOD
Notification — prefs:root=NOTIFICATI*****_ID
Safari — prefs:root=Safari
Siri — prefs:root=General&path=Assistant
Usage — prefs:root=General&path=USAGE
VPN — prefs:root=General&path=Network/VPN