我正在尝试显示带有蓝牙权限的自定义屏幕,该按钮将触发权限警报。问题是,CBCentralManager的授权返回notDefineded,但是当我尝试强制警报时,我什么也没得到。 我正在使用的代码是这样的:
-(void) checkForBluetoothOn{
if(!self.bluetoothManager) {
self.bluetoothManager = [[CBCentralManager alloc] initWithDelegate:self queue:dispatch_get_main_queue() options:@{CBCentralManagerOptionShowPowerAlertKey: @(NO)}];
}
[self.bluetoothManager scanForPeripheralsWithServices:@[[CBUUID UUIDWithString:@"1819"],[CBUUID UUIDWithString:@"1820"]] options:nil];
}
- (void)centralManagerDidUpdateState:(CBCentralManager *)central{
//Process state change
}