iOS11 Beta 8 - CBPeripheralManager State Restoration Bug?

Hi all,


Has anyone else run into issues with CBPeripheralManager State Restoration on the iOS 11 Betas so far? I filed bug report (https://bugreport.apple.com/web/?problemID=34168225)for the below but has anyone else come across similar issues? I can see several reports of issues for CBCentralManager state restoration which I believe is now fixed but none for CBPeripheralManager restoration.


Thanks


Bug Report


On iOS11 Beta 8 - CBPeripheralManager State Restoration appears to be broken. In scenarios where an app should be relaunched in the background to allow for CBPeripheralManager restoration this does not occur. didFinishLaunchingWithOptions is not called unlike the same scenario on iOS 10.3.3 and earlier versions of iOS.


Steps to Reproduce:

1. On iPhone 1 create a CBPeripheralManager that is background enabled.

2. Create a service and some characteristics and startAdvertising these on the peripheral.

3. Background the app

4. Open other apps on iPhone 1 until the app is 'Terminated due to memory pressure'

5. From another device (iPhone 2) scan for the peripheral and connect.


Expected Results: On iPhone 1 in the device logs the terminated app should be relaunched in the background and this callback fired allowing for the PeripheralManager to be restored correctly.


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
     NSArray *peripheralManagerIdentifiers = launchOptions[UIApplicationLaunchOptionsBluetoothPeripheralsKey];

     if ([peripheralManagerIdentifiers count] > 0) {

          for (NSString *peripheralManagerID in peripheralManagerIdentifiers) { /
               // Check IDs and restore Peripheral Manager if appropriate

          }
     }
}


Observed Results: Viewing iPhone 1 device logs the terminated app is not relaunched when iPhone 2 connects and didFinishLaunchingWithOptions is never called so it is impossible to restore the PeripheralManager and handle events as in iOS 10 and earlier versions of iOS

I have a similar issue, in my case:

1) Create the PeripheralManager.

2) Add a service with a WriteWithoutResponse characteristic.

3) background and terminate the app due to memory pressure.


Now, on iOS 10, if I try to write the characteristic from a connected device the app wakes up, restores the Peripheral Manager and performs the didReceiveWrite delegate method. On iOS11, instead, nothing happens.

Thanks for confirming - have you filed a bug report? Hopefully a fix will be coming soon.

Still an issue with iOS 11.1 beta 1. I've filed a bug report (34568166), please everyone else who's having this issue do the same so it's fixed!

To keep everyone updated, just recieved a notificadtion from Apple saying that my bug report is a duplicate so at least one other person has filed a bug report, so that's something. Hopefully it gets fixed before 11.1 is released.

iOS11 Beta 8 - CBPeripheralManager State Restoration Bug?
 
 
Q