Hi! I'm using AccessorySetupKit with CoreBluetooth state restoration. My understanding is that using AccessorySetupKit is a now pre-requisite to enabling the state restoration/preservation apis, so I went that route — and pairing, handoff, and restoration on search discovery or connection completion seem to be working
Where I'm stuck: my accessory is poll-based. I read it by writing a request and reading the response. Then I send a new request. the BLE accessory never pushes data on its own. Since restoration only seems to wake my app on an inbound BLE event, if the app gets terminated mid-session while the connection's still healthy, nothing wakes the app and polling just quietly stops.
Is there a recommended way to handle this for a request/response device? Thanks!
CoreBluetooth tech notes can be found here
In order to get runtime when app is suspended or get your app restored if killed is to make sure accessory is sending information over Bluetooth. This can either be a notification from the accessory over the connection, or you can scan for it and advertise a different payload indicating it has data, which will wake your app as the new payload is different and will get through the duplicate filter.