ios10以后之前的跳轉(zhuǎn)好像不能用了,好像只能跳轉(zhuǎn)到本應(yīng)用的設(shè)置中,所以只好加了版本的判斷
#define IOS10_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0)
NSURL *url;
if (IOS10_OR_LATER) {
url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
}else{
url = [NSURL URLWithString:@"prefs:root=Bluetooth"];
}
// 判斷是否能打開URL
if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
}
其他跳轉(zhuǎn)的URL可參考文章:http://www.reibang.com/p/98d28bad06c5