一、
现在程序中使用到了蓝牙功能,但是在蓝牙关闭的情况下,程序每次运行都会提示“打开蓝牙来允许连接到配件”,控制这个系统提示
//没有系统提示
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], CBCentralManagerOptionShowPowerAlertKey, nil];
self.cbmanager = [[CBCentralManager alloc]initWithDelegate:self queue:nil options:options];
// 有系统提示
// self.cbmanager = [[CBCentralManager alloc] initWithDelegate:self queue:nil];
二、跳转到设置里的打开蓝牙
NSURL *url = [NSURL URLWithString:@"prefs:root=Bluetooth"];
if ([[UIApplication sharedApplication] canOpenURL:url])
{
[[UIApplication sharedApplication] openURL:url];
}