iOS 应用内打开系统设置
2016-11-02 17:13
281 查看
一 调用方法
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000[[UIApplication sharedApplication] openURL:[NSURL URLWithString:path] options:@{} completionHandler:nil];
#else
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:path]];
#endif
二 参数值
@[@"Wi-Fi", @"App-Prefs:root=WIFI"],@[@"Bluetooth",@"App-Prefs:root=Bluetooth"],
@[@"mobile network", @"App-Prefs:root=MOBILE_DATA_SETTINGS_ID"],
@[@"Internet share", @"App-Prefs:root=INTERNET_TETHERING"],
@[@"Carrier", @"App-Prefs:root=Carrier"],
@[@"notification", @"App-Prefs:root=NOTIFICATIONS_ID"],
@[@"General", @"App-Prefs:root=General"],
@[@"About", @"App-Prefs:root=General&path=About"],
@[@"Keyboard", @"App-Prefs:root=General&path=Keyboard"],
@[@"Wallpaper", @"App-Prefs:root=Wallpaper"],
@[@"Profile", @"App-Prefs:root=General&path=ManagedConfigurationList"],
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000
@[@"Siri", @"App-Prefs:root=SIRI"],
#else
@[@"Siri", @"App-Prefs:root=General&path=SIRI"],
#endif
@[@"Privacy", @"App-Prefs:root=Privacy"],
@[@"location", @"App-Prefs:root=Privacy&path=LOCATION"],
@[@"Microphone ", @"App-Prefs:root=Privacy&path=MICROPHONE"],
@[@"Contacts ", @"App-Prefs:root=Privacy&path=CONTACTS"],
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000
@[@"Safari", @"App-Prefs:root=Safari"],
#else
@[@"Safari", @"App-Prefs:root=SAFARI"],
#endif
@[@"music", @"App-Prefs:root=MUSIC"],
@[@"music-EQ", @"App-Prefs:root=MUSIC&path=com.apple.Music:EQ"],
@[@"photos & camera", @"App-Prefs:root=Photos"]
三 说明
1. #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000 判断系统是否大于iOS 102. 以上参数已在iOS9 & iOS10 测试通过