I got the following response from an apple developer :
In iOS7, the CBCentralManagerOptionShowPowerAlertKey
option lets you disable this alert.
If you have a CBCentralManager
, then when you initialise it, you can use the method -[CBCentralManager initWithDelegate:queue:options]
Example:
In my .h file, I have a CBCentralManager * manager
.
In my .m file:
NSDictionary *options = @{CBCentralManagerOptionShowPowerAlertKey: @NO};
_manager = [[CBCentralManager alloc] initWithDelegate:self queue:nil options:options];
[_manager scanForPeripheralsWithServices:nil options:options];
With this code, the warning no longer appears. I hope that helps!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…