打开app设置界面
NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
[[UIApplication sharedApplication]openURL:url];
在iOS11之前使用prefs:root=Bluetooth
,打开其他的直接Bluetooth换成其他的关键字。
在iOS11之后换成了@"App-Prefs:root=General&path=Bluetooth"
,关键代码如下:
在iOS11中只能跳转设置界面,跳转蓝牙界面暂时做不到。
if (OS_Version<= 10) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=Bluetooth"]];
}else {//prefs:root=Bluetooth
NSURL* url = [NSURL URLWithString: @"App-Prefs:root=General&path=Bluetooth"];
[[UIApplication sharedApplication] openURL:url];
}
网友评论