There are many related questions but (apparently) no answers. SO...
My iOS app does get updates from my BLE device while the app is in background. If I lose touch with the BLE device, then in centralManager:didDisconnectPeripheral:
I call -[CBCentralManager cancelPeripheralConnection:]
-- otherwise I will never reconnect to the lost peripheral. Then I call [(re)call -[CBCentralManager scanForPeripheralsWithServices:options:]
.
Logging shows me that the didDisconnectPeripheral
call, and its contained calls, are both happening while in background. However, the reconnect only happens when the app wakes up from background.
So I am able to communicate with the connected BLE device while in background (yay!) but not to reconnect. This is quite important to my app, and (one would think) to other apps. Suggestions welcome.