Unable to use Bluetooth in watchOS companion app if iOS uses AccessorySetupKit

FB18383742

Setup

🛠️ Xcode 16.4 (16F6)
📱 iPhone 13 mini (iOS 18.0.1)
⌚️ Apple Watch Series 10 (watchOS 11.3.1)

Observations

  • As AccessorySetupKit does not request "Core Bluetooth permissions", when a watchOS companion app is installed after having installed the iOS app, the toggle in the watch settings for Privacy & Security > Bluetooth is turned off and disabled
  • After removing the iPhone associated with the Apple Watch, Bluetooth works as expected in the watchOS app
  • Upon reinstalling the iOS app, there's a toggle for Bluetooth in the iOS ASK app's settings and the ASK picker cannot be presented 🤨
  • From ASK Documentation:

AccessorySetupKit is available for iOS and iPadOS. The accessory’s Bluetooth permission doesn’t sync to a companion watchOS app.

  • But this doesn't address not being able to use Core Bluetooth in a watch companion app at all 🥲

Reproducing the bug

  • Install the iOS + watchOS apps

  • Launch iOS app, tap "start scan", observe devices can be discovered (project is set up to find heart rate monitors)

  • Launch watchOS, tap allow on Bluetooth permission pop-up

  • watchOS app crashes 💥

  • Meanwhile, in the iOS app, there should be a log entry for 💗 CBCentralManager state: poweredOff and the ASK picker is no longer able to discover any devices

  • The state of the device permissions:

    • iOS app has no paired accessories or Bluetooth permission
    • watchOS app's Bluetooth permission shown as turned off & disabled
  • Remove the iOS app

  • Relaunch the watchOS app

  • Notice the CBCentralManager state is unauthorized

  • Remove and reinstall the watchOS app

  • Tap allow on Bluetooth permission pop-up

  • watchOS app does not crash and CBCentralManager state is poweredOn

  • The state of the watch permissions:

    • Bluetooth is turned on & the toggle is not disabled
  • Note that at this time the iOS app is not installed, there is no way to remove Bluetooth permission for the watch app.

  • Reinstall + launch the iOS app

  • Notice a warning in the log:

[##### WARNING #####] App has companion watch app that maybe affected if using CoreBluetooth framework. Please read developer documentation for AccessorySetupKit.

  • Notice a log entry for 💗 CBCentralManager state: poweredOn before tapping start scan
  • Tap start scan and observe another log entry:

Failed to show picker due to: The operation couldn’t be completed. (ASErrorDomain error 550.)

  • ASErrorDomain 550:

The picker can't be used because the app is in the background.

  • Is this the expected error? 🤔
  • The state of the iOS permissions:
    • The app's settings show a Bluetooth toggle normally associated with Core Bluetooth, but the app never showed a Core Bluetooth pop-up
  • The iOS ASK app now has Core Bluetooth permission 😵‍💫

Following up with Apple

  • This is a known bug that should be fixed in watchOS 26 when Bluetooth permissions for watch apps can be set independently of the iOS app. I've yet to test it with watchOS 26.

See repo for the same post with screenshots of the settings and demo code reproducing the bug:

https://github.com/superturboryan/AccessorySetupKit-CoreBluetooth-watchOS-Demo

this is a great find! thanks for sharing

Unable to use Bluetooth in watchOS companion app if iOS uses AccessorySetupKit
 
 
Q