Application not resumed when observing CBCharacteristic, and peripheral reconnects

Originator:me
Number:rdar://15971751 Date Originated:
Status:Open Resolved:
Product:iOS Product Version:7.1b4
Classification:UI/Usability Reproducible:Always
 
Core Bluetooth on iOS 7 provides the ability for an application to register for notifications when a peripheral’s characteristic changes, and if the app is not in memory it will be re-launched and the CBCentralManager’s state restored.

However, if while the app is not running (e.g. jettisoned for memory) the peripheral disconnects and later reconnects, the observation is not restored, nor is the app restored to be notified of the new connection.

In our case, we have a Fitbit activity tracker that maintains a connection to the iOS device to display notifications via ANCS, so iOS will re-connect to the peripheral when possible. The peripheral also notifies on a characteristic when it has data to sync to the user’s Fitbit account, which the app watches for.



Expected Results:
Expected behavior is for the application to be re-launched and notified of the new connection, via CBCentralManagerRestoredStatePeripheralsKey:

“CBCentralManagerRestoredStatePeripheralsKey
An array (an instance of NSArray) of CBPeripheral objects that contains all of the peripherals that were connected to the central manager (or had a connection pending) at the time the app was terminated by the system.”


Actual Results:
Application is not restored by the system.

Comments

Isn't bluetooth-central background mode an option for your case? See for ref.: https://developer.apple.com/library/prerelease/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!