We have a project that uses CoreLocation regions to monitor the iBeacon I / O area in the background of the application. CLBeaconRegion (CLRegion), CLBeacon, etc. CLLocationManager returns callbacks when the CLBeacon (iBeacon) scope is entered. This is a lightweight cover around the bluetoothManager below.
- (void) locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region;
- (void) locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region;
The problem is that when the user didnβt turn on bluetooth, Iphone regularly gives a warning about the system level to "Turn on Bluetooth to allow" APP_NAME "to connect additional accessories." This happens a lot, I get it 4 times this morning as the application is running in the background. CLLocationManager may try to control these CLBeaconRegion, but bluetooth is turned off, so it cannot do this.
Another post mentions that CBCentralManager has the CBCentralManagerOptionShowPowerAlertKey property that allows you to disable this warning.
iOS CoreBluetooth passively checks if Bluetooth is turned on without prompting the user to turn on Bluetooth .
Unfortunately, I did not find a way to access the underlying Bluetooth or any CBCentralManager link to use this.
Is there a way to disable this warning for monitoring CLBeaconRegion?

source
share