5

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.

O'Rooney
  • 2,878
  • 2
  • 27
  • 41

3 Answers3

10

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.

O'Rooney
  • 2,878
  • 2
  • 27
  • 41
1

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}];
spnkr
  • 952
  • 9
  • 18
  • Which kind of "disabled" do you mean? In the control centre, or in settings? – O'Rooney May 30 '22 at 23:32
  • 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. – spnkr Jul 07 '22 at 20:47
  • They are not the same thing. Turning it off in settings does fully turn the bluetooth radio off. Turning it off in control centre leaves the radio on, and still allows some connections to work like Apple Watch or headphones. It just prevents any new connections. – O'Rooney Jul 08 '22 at 04:57
0

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])
Boris Nikolic
  • 746
  • 14
  • 24