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

Viewed 1045

Since iOS13, our app which uses BLE beacons for location, now gets two Bluetooth related permissions prompts.

The first one is understandable and expected:

Prompt to use Bluetooth

The second prompt is not expected, and we don't know why it's happening.

Prompt to "use Bluetooth for new connections"

FYI the app is currently compiled with the previous iOS SDK/XCode.

3 Answers

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.

Swift 5 / To disable "APP_NAME would like to use Bluetooth for new connections" alert use options when instantiating CBCentralManager:

var centralManager = CBCentralManager(delegate: YOUR_DELEGATE?, queue: YOUR_QUEUE?, options: [CBCentralManagerOptionShowPowerAlertKey: 0])

By default, when Bluetooth is disabled every time you create a CBCentralManager this pop-up will appear.

By disabled I mean the bluetooth radio turned off. you can do this via the control center, or in your phone's settings. this is different from denying an app bluetooth permissions.

If you add a CBCentralManagerOptionShowPowerAlertKey to the options when creating your CBCentralManager this pop-up will not appear.

Swift:

let manager = CBCentralManager(delegate: nil,
                               queue: nil,
                               options: ["CBCentralManagerOptionShowPowerAlertKey": 0])

Objective-C:

[[CBCentralManager alloc] initWithDelegate:self
                                     queue:nil
                                   options:@{CBCentralManagerOptionShowPowerAlertKey: @0}];
Related