iOS 11 Beta bluetooth state issue

Hello,


Since I started testing out with the iOS 11 betas I have been seeing some strange Core Btuetooth behaviors. The biggest issue for me is that very often when the app is launched the CBCentralManager state will be set to CBManagerStatePoweredOff and stay that way until I manually toggle bluetooth. It does not appear to happen when I launch the app by pressing the App Icon, but rather when I launch it either from the debugger, or when the app is launched by CB state restoration.


Am I the only one seing this issue?

I am currently on the latest beta (as of Aug 1).


/A

Replies

I will try and be more specific on how to reproduce:


1) Implement State Preservation and Restoration in your app

2) Connect (and BT pair) a peripheral

3) While the peripheral is still connected kill the app from Xcode

4) Run the app again from Xcode

5) At this time the CBCentralManager's state will stay at CBManagerStatePoweredOff and the peripheral can not connect to the app again.


At this point I can mention that the peripheral stays connected to the iOS system and bluetooth continues to function as usual in other apps, but Core Bluetooth is useless in this app until bluetooth is toggled off/on again, or if you swipe kill and relaunch from the home screen. Tested on iOS 11 beta 4 iPhone 7.

If you are seeing problems, or, behavior which is not expected or not ideal, best is to file a bug report at https://bugreport.apple.com

while we are still in the beta cycle

Has the bug been resolved or has a workaround been discovered? I'm having the same issue but I'm on the production release of iOS 11.

Is there a way to view the status of a bug filed by another developer? I'm having the same issue and wanting to see the status of this bug.

I'm having very similar issues with state restoration. Filed radar 34568166.
http://www.openradar.me/34568166


Broken in iOS 11 and so far iOS 11.1 beta 1. Pretty core feature of Bluetooth broken with no word from Apple on a fix.

This bug was fixed a long time ago. I don't understand why you are still seeing this. How are you testing is?

To my knowledge you can't see bugs filed by other developers unless they have also submitted it to openradar.

Hey Antome,


This is the same issue you commented on StackOverflow for me. The issue I am having isn't necessarily with Bluetooth being disabled but rather the app doesn wake when terminated by OS and user interacts with the peripheral. I am also seeig an issue when willRestoreState is called at launch then I am unable to connect the periphials serivces. Plesae see more explination of my issue here.

Has the bug been resolved or has a workaround been discovered?

Checked status on your bug lately? Anything new?

It was fixed as part of iOS 11.2 but still broken when running an app built using Xcode 9.2 on anything between iOS 11.0 and iOS 11.2. It’s not difficult to reproduce for a CBPeripheralManager app because willRestoreState is called when re-launching the app but there are no services provided in the callback.

It seems that the problem still exists. Our environment is iOS 11.2.1 with Xcode 9.2. Although the bluetooth of my iPhone is on, the method below return .poweroff status.

centralManagerDidUpdateState(_ central: CBCentralManager) {
   print(central.state.rawValue)
   bluetoothAvailable = (central.state == .poweredOn)
}