Why do I get CBCentralManagerStateUnknown
on an iPad 2 when using this simple code?
- (BOOL)viewDidLoad {
bluetoothManager = [[CBCentralManager
If a central's state goes to CBCentralManagerStateUnsupported
(while Bluetooth Low Energy is supported by the device) it most likely means the app has done something bad with CoreBluetooth.
Check the iOS Bluetooth Diagnostic Logging logs.
For example, if you do this...
_cm1 = [[CBCentralManager alloc] initWithDelegate:self queue:nil options:@{ CBCentralManagerOptionRestoreIdentifierKey: @"not_unique" }];
_cm2 = [[CBCentralManager alloc] initWithDelegate:self queue:nil options:@{ CBCentralManagerOptionRestoreIdentifierKey: @"not_unique" }];
... the second central's state will go to CBCentralManagerStateUnsupported
.