Hello Apple Developer Forums,
We are developing an iOS companion app that supports multiple Bluetooth earbud products, and we are evaluating AccessorySetupKit for one specific product family.
Our current product situation is:
EU:
Earbud A → AccessorySetupKit
Earbud B → legacy CoreBluetooth discovery
Earbud C → legacy CoreBluetooth discovery
Earbud D → legacy CoreBluetooth discovery
Earbud E → legacy CoreBluetooth discovery
Non-EU:
Earbud A → legacy CoreBluetooth discovery
Earbud B → legacy CoreBluetooth discovery
Earbud C → legacy CoreBluetooth discovery
Earbud D → legacy CoreBluetooth discovery
Earbud E → legacy CoreBluetooth discovery
Only Earbud A needs to adopt AccessorySetupKit. The other four products are existing products and need to keep their current CoreBluetooth discovery and authentication flow.
According to Apple's AccessorySetupKit documentation, an app using AccessorySetupKit needs to declare:
<key>NSAccessorySetupKitSupports</key>
<array>
<string>Bluetooth</string>
</array>
Apple's documentation also describes AccessorySetupKit as the mechanism for discovering and configuring Bluetooth accessories:
https://developer.apple.com/documentation/accessorysetupkit/discovering-and-configuring-accessories
Our concern is the interaction between this declaration and the existing CoreBluetooth discovery flow.
For the AccessorySetupKit-managed product, the intended flow is:
ASAccessorySession
↓
Accessory Picker
↓
User authorization
↓
CoreBluetooth communication
For the other existing products, we need to retain:
CBCentralManager
↓
scanForPeripherals()
↓
Discover nearby peripheral
↓
User selects device
↓
Existing authentication / binding flow
We understand from Apple's WWDC24 AccessorySetupKit session that once AccessorySetupKit is involved, CoreBluetooth scanning is subject to the AccessorySetupKit authorization model.
This raises an important compatibility question for us.
If the application declares:
<key>NSAccessorySetupKitSupports</key>
<array>
<string>Bluetooth</string>
</array>
but only one product family is intended to use AccessorySetupKit, can the same application continue to perform unrestricted CoreBluetooth discovery for the other four legacy Bluetooth products?
For example:
Nearby:
Earbud A → ASK-managed
Earbud B → legacy
Earbud C → legacy
Expected:
ASK Picker
→ Earbud A
CBCentralManager.scanForPeripherals()
→ Earbud B
→ Earbud C
Or does declaring NSAccessorySetupKitSupports = Bluetooth cause CoreBluetooth discovery to be restricted to accessories that have already been authorized through AccessorySetupKit?
We are particularly concerned about first-time discovery of a legacy accessory:
User upgrades the app
↓
Earbud B has never been authorized through AccessorySetupKit
↓
Earbud B is nearby
↓
The app needs to discover Earbud B for the first time
↓
Existing CBCentralManager discovery flow
If CoreBluetooth discovery is restricted after AccessorySetupKit is enabled, we don't see how the app can discover this new legacy accessory in order to continue using the existing flow.
We are aware of ASMigrationDisplayItem and the AccessorySetupKit migration mechanism for existing Bluetooth accessories. However, migration appears to require an already-known peripheral identifier, so we are unsure how this applies to a new legacy accessory that has never been discovered or authorized through AccessorySetupKit.
Questions
-
Is it officially supported for one application to use AccessorySetupKit for only one Bluetooth product family while continuing unrestricted CoreBluetooth discovery for other Bluetooth product families?
-
If yes, what is the recommended architecture/API configuration?
-
Does
NSAccessorySetupKitSupports = Bluetoothaffect CoreBluetooth discovery globally for the application, or can its effect be limited to specific accessory families throughASDiscoveryDescriptor? -
How should an application discover a new, previously unauthorized legacy Bluetooth accessory after AccessorySetupKit has been enabled?
-
Is there an Apple-recommended migration strategy for an application that has multiple existing Bluetooth product families, where only one product family is required to adopt AccessorySetupKit?
Any clarification from Apple on the officially supported architecture would be greatly appreciated.
Thank you.