iOS Corebluetooth Passively Check If Bluetooth Is Enabled Without Prompting User to Turn Bluetooth On

iOS CoreBluetooth passively check if Bluetooth is enabled without prompting user to turn Bluetooth on

iOS 7 has a new options parameter in the create of CBCentralManager to turn this off, named CBCentralManagerOptionShowPowerAlertKey

I'd love a solution for earlier iOS.

Check if Bluetooth is Enabled?

The only way I've ever found to do this is with private frameworks (like Bluetooth Manager, for one) that are only useful for Jailbroken apps... and Apple will reject any app using a private framework. I believe it's even against their ToS to do anything with bluetooth, so you're out of luck there.

What causes this iOS permission prompt for use Bluetooth for new connections?

I think that this second prompt is a new iOS13 variation on "please enable Bluetooth" and that it appears because the user has set Bluetooth to "off" in the control centre, but not turned Bluetooth fully off in Settings.

The description of "use Bluetooth for new connections" seems to correspond to the "partially enabled" state (white button in control centre).

This second prompt can be stopped using the CBCentralManagerOptionShowPowerAlertKey: @(NO) option to the CBCentralManager init call.



Related Topics



Leave a reply



Submit