禁掉系统蓝牙的弹窗
2017-06-10 本文已影响134人
取个id好难
由于业务要求,需要禁掉蓝牙的系统弹窗
1.从app应用安装到手机,只会弹一次系统弹窗
初始化方式为:
manager = [[CBCentralManageralloc]initWithDelegate:selfqueue:dispatch_get_main_queue()options:nil];
2.每次初始化蓝牙api都会弹框
CBCentralManager*manager = [[CBCentralManageralloc]initWithDelegate:selfqueue:dispatch_get_main_queue()];
3.禁止系统蓝牙弹框
初始化蓝牙api
manager = [[CBCentralManageralloc]initWithDelegate:selfqueue:dispatch_get_main_queue()options:@{}];
options后参数默认为CBCentralManagerOptionShowPowerAlertKey:@(NO)
若CBCentralManagerOptionShowPowerAlertKey对应的value为YES,则效果跟2相同