In my app, I am able to successfully connect to a BLE peripheral and subscribe to a characteristic, so that the app gets notified whenever there is a change in the characteristic value. But the app is not notified upon changes in characteristic value after the central manager is reinitialized during state restoration. Below is what I do during state restoration:
- In didFinishLaunchingWithOptions: I re-instantiate central manager object with the restoration identifier.
- Then in centralManager:willRestoreState: method, I retrieve
previously connected peripherals and reconnect to them using
CBCentralManagerRestoredStatePeripheralsKey.
Will simply reconnecting to the peripherals will do the characteristics subscription internally or finding services and subscribing to characteristic to be done explicitly as it is done during first launch ?