Post

Replies

Boosts

Views

Activity

Reply to App does not wake up in the background when using AccessorySetupKit and Bluetooth background modes
I had a bit of a revelation - I noticed my phone battery was around 21% when it wasn't connecting in the background. I plugged in my phone and repeated my tests by placing the device I'm working with in/out of the faraday bag, and I verified that the .bluetoothCentrals key would wake up my app, so I'm guessing iOS doesn't try to reconnect to peripherals in the background when the battery is low - is there a specific percentage this happens at? I would have expected 20% since that's when you get the 'Low Battery' alert, but i was definitely >20%. Thanks so much @DTS Engineer Kevin! You all are truly the underappreciated superheroes in the apple development ecosystem (the number of threads Quinn answers must be around 1% of the content of the internet itself), and I appreciate the care and thought you all put to your responses on these support threads.
2w
Reply to App does not wake up in the background when using AccessorySetupKit and Bluetooth background modes
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?
2w