在iOS10更新后,系统设置跳转被禁用,只能跳转App设置,但是最近发现苹果又更新了URLscheme,亲测可用,建议iOS10以下,还用原来的scheme(原来的scheme为prefs)
#define iOS10 ([[UIDevice currentDevice].systemVersion doubleValue] >= 10.0) NSString* urlString = @"App-Prefs:root=WIFI";
if([[UIApplicationsharedApplication] canOpenURL:[NSURLURLWithString:urlString]]) {
if(iOS10) {
[[UIApplicationsharedApplication] openURL:[NSURLURLWithString:urlString] options:@{} completionHandler:nil];
}else{
[[UIApplicationsharedApplication] openURL: [NSURLURLWithString:@"prefs:root=WIFI"]];
}
}
附录:iOS10之后,其它界面的跳转
当前iOS10支持的所有跳转,亲测可用(测试系统:10.2.1)跳转 写法无线局域网App-Prefs:root=WIFI蓝牙App-Prefs:root=Bluetooth蜂窝移动网络App-Prefs:root=MOBILE_DATA_SETTINGS_ID个人热点App-Prefs:root=INTERNET_TETHERING运营商App-Prefs:root=Carrier通知App-Prefs:root=NOTIFICATIONS_ID通用App-Prefs:root=General通用-关于本机App-Prefs:root=General&path=About通用-键盘App-Prefs:root=General&path=Keyboard通用-辅助功能App-Prefs:root=General&path=ACCESSIBILITY通用-语言与地区App-Prefs:root=General&path=INTERNATIONAL通用-还原App-Prefs:root=Reset墙纸App-Prefs:root=WallpaperSiriApp-Prefs:root=SIRI隐私App-Prefs:root=PrivacySafariApp-Prefs:root=SAFARI音乐App-Prefs:root=MUSIC音乐-均衡器App-Prefs:root=MUSIC&path=com.apple.Music:EQ照片与相机App-Prefs:root=PhotosFaceTimeApp-Prefs:root=FACETIME