Does that mean that after the user pairs the two and we establish the connection with CoreBluetooth and include CBConnectPeripheralOptionEnableAutoReconnect and the user walks in range of the peripheral, it should launch the app with .bluetoothCentrals launch key, and automatically reconnect without any need to scan? I've made sure to activate the ASAccessorySession when the app loads.
In my testing, what I do is launch the app via Xcode, put my device in a faraday bag and verify that it's disconnected, hit the Stop button in Xcode, and then take the device out of the faraday bag. I notice that sometimes the device does reconnect while the app is in the background (i verified this by pinging my server when the app is launched with .bluetoothCentrals key). But when I put the device back in the faraday bag, wait sometime, and then take it out again, I don't see the expected pings (I ping my server when the device reconnects as well). This seems to only happens when paired via ASK.
I'm wondering if this has to do with the ASAccessorySession session somehow stopping working at some point in the background? Could the session be getting invalidated some how? Is there a way to detect that, and what should I do if it does that while my app is suspended or backgrounded?
Topic:
App & System Services
SubTopic:
Networking