在iOS 13上触发蓝牙权限警报

时间:2019-10-03 12:02:00

标签: ios bluetooth core-bluetooth ios13

我正在尝试显示带有蓝牙权限的自定义屏幕,该按钮将触发权限警报。问题是,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
}

0 个答案:

没有答案
相关问题