Handling BLE Permissions for CBCentralManager and AccessorySetupKit to Support iOS 18 and Earlier Versions

I have an iOS app where I perform BLE scans using the scanForPeripherals() method in CBCentralManager, which requires the NSBluetoothAlwaysUsageDescription permission. Recently, I added BLE accessory scanning using AccessorySetupKit, which requires the NSAccessorySetupKitSupports permission. This is to support the app on devices running iOS 18 (where AccessorySetupKit is available) as well as on earlier iOS versions (where this framework is not available).

However, I am facing an issue where including both permissions in the app causes NSAccessorySetupKitSupports to override the NSBluetoothAlwaysUsageDescription permission. As a result, the scanForPeripherals() method in CBCentralManager no longer works on older versions.

Is it possible to use both scanning methods in the same app while ensuring the required permissions coexist? If so, how can this be achieved?

There should not be a conflict between these two Info.plist entries.

Why do you say one is overriding the other? What effect makes you believe that? Are you certain these strings are in the Info.plist correctly? Have you checked the built app to see if both entries are in the Info.plist file?

There could be a build configuration where you might be including a different Info.plist than you think you are perhaps?

Hi,

Thanks for your response.

I’ve double-checked the Info.plist entries, and everything seems correct. To rule out potential issues with my app’s configuration, I tested the behavior by initiating a CBCentralManager scan in the sample app provided in the Apple Developer portal for AccessorySetupKit.

I only added the ‘Privacy - Bluetooth Always Usage Description’ key to the Info.plist. However, when initializing CBCentralManager, its state is consistently reported as ‘Powered Off’ and never transitions to ‘Powered On’.

I’ve shared the updated ASKSample project source for reference. Could you please review it and confirm if I’m missing anything in the plist configuration or elsewhere?

The goal of this exercise is to enable BLE peripheral discovery using AccessorySetupKit and CBCentralManager within the same app, ensuring support for BLE communication on iOS 18 and earlier versions.

Thanks in advance for your help! Source files: https://www.icloud.com/iclouddrive/084F4uKQwzlrYgWAkVyEesxCQ#AuthorizingABluetoothAccessoryToShareADiceRoll

I have some clarification about this. CBCentralManager permissions and AccessorySetupKit are mutually exclusive in use within an app.

You can use one or the other. On iOS 18, if you choose to use AccessorySetupKit, you can no longer scan the old way. You can have both in your app, and iOS 17 and below will ignore the ASK entries, and on iOS 18, you need to commit to using ASK.

We have documentation and a sample app (Authorizing a Bluetooth accessory to share a dice roll, https://developer.apple.com/documentation/accessorysetupkit/authorizing-a-bluetooth-accessory-to-share-a-dice-roll) which demonstrates how your existing code will work on iOS 18 with ASK and pre-iOS 18 can stay as-is.

If you choose to use AccessorySetupKit, after iOS 18, all permissioning will need to go through that. You cannot use the old CoreBluetooth APIs as you did before. Do understand that migrating to ASK is optional.


Argun Tekant /  DTS Engineer / Core Technologies

Handling BLE Permissions for CBCentralManager and AccessorySetupKit to Support iOS 18 and Earlier Versions
 
 
Q