CoreBluetooth state restoration does not get restored after rebooting iOS device

Originator:martijn
Number:rdar://21320078 Date Originated:10-Jun-2015 05:06 PM
Status:Open Resolved:No
Product:iOS Product Version:9.0 beta 1
Classification:Serious Bug Reproducible:Always
 
Summary:
An application can use CoreBluetooth state restoration to "persist" GATT services that it provides or to "persist" its intent to connect to devices, even though the app might crash or get jettisoned by iOS. However, when iOS reboots (either by the user manually rebooting, the battery running dry or a kernel panic), the state is not properly restored after the reboot and the user has to manually open the iOS applications again. This is a suboptimal user experience.

It is also very problematic for applications and devices that do their work "in the background" without no user interaction, like (health) monitoring systems.

This bug has been around since iOS 7 and it has been a great source of complaints from within the developer community. Please do something about it!

Dupe of #14206719

Steps to Reproduce:
1. Create an app that uses CoreBluetooth state restoration (I can provide a sample project if needed)
2. Launch the app
3. Observe that the app can connect to an accessory and any services it hosts are available from any connected accessory
4. Reboot the iOS device
5. Observe that the app is not relaunched automatically nor is iOS reconnecting to the accessory on behalf of the app
5. Use another app like LightBlue for iOS to connect manually to the accessory
6. Perform service discovery on the iOS device from the accessory
7. Observe any services hosted by the app are not made available any more by iOS (on behalf of the app)

Expected Results:
After a reboot of iOS, any Bluetooth Smart devices for which apps using CoreBluetooth state restoration had connected to, should be attempted to be connected to again by iOS (on behalf of the app), without the user having to launch the app manually.

After a reboot of iOS, any CBMutableService registered by apps using CoreBluetooth state restoration, should be added to iOS' GATT database again, without the user having to launch the app manually.

Actual Results:
iOS does not attempt to connect again to any Bluetooth Smart device, even though it was connected prior to the reboot.

iOS does not re-register any CBMutableService that was registered prior to the reboot.

Version:
iOS 9 beta 1 (13A4254v)

Notes:


Configuration:
iPhone 5 (A1429)

Attachments:

Comments


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!