Disclaimer: This article is a blogger original article, reproduced, please indicate the source of the article. https://blog.csdn.net/SunFlowerInRain/article/details/76615852
In iOS development, sometimes jumps demand system settings interface, for example, the user is prompted to turn on Bluetooth or WIFI, to remind the user to push open position or authority and so on.
There are three ways to set the jump, each of which have different usage scenarios. And you jump to their own application system set below, your application to be filed in advance at least one authority, such as notification, location and so on. Otherwise, it will cause a crash.
方式一:prefs:root=某项服务
方式二:prefs:root=bundleID
方式三: UIApplicationOpenSettingsURLString
Jump
when the iOS system version <time = iOS7, can only jump to the System Settings page
NSURL *url= [NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"];
跳转到: 隐私-定位服务。
prefs:root=某项服务
系统设置: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
蜂窝网路:prefs:root=MOBILE_DATA_SETTINGS_ID
音乐:prefs:root=MUSIC
APP Store:prefs:root=STORE
Notes:prefs:root=NOTES
Safari:prefs:root=Safari
Music:prefs:root=MUSIC
photo":prefs:root=Photos
这种跳转方式,都是跳转到系统的设置界面。
When the iOS system version> = iOS8, support jumps to third-party application settings interface is used prefs:root= bundleID
,
bundleID是你第三方应用工程的唯一ID 局限性:只支持iOS8,iOS9系统,在iOS10系统上,不会跳转。
当系统版本号大于iOS
UIApplicationOpenSettingsURLString字段,是在iOS8上才提供的,支持iOS8,iOS9,iOS10系统,推荐使用。