centralManagerDidUpdateState is not called after user selection in Bluetooth permissions dialog

Hi, team.

We are implementing a process to obtain Bluetooth usage permissions in order to use Bluetooth by iPhone, and we are having some unexpected behavior in the process, so we need someone's help.

The problematic behavior is that the centralManagerDidUpdateState is not called after the user makes a selection in the Bluetooth authorization dialog.

Expected behavior

  1. Instantiation of CBCentralManager
  2. Bluetooth authorization dialog appears on the screen
  3. Select "Allow" in the permission dialog
  4. After selection, centralManagerDidUpdateState is called
  5. CBManager.authorization becomes .allowedAlways

Problem behavior

  1. Instantiation of CBCentralManager
  2. Bluetooth authorization dialog appears on screen
  3. centralManagerDidUpdateState is called before selection
  4. Select "Allow" in the authorization dialog
  5. After selection, centralManagerDidUpdateState is not called

What could cause the centralManagerDidUpdateState to be called at such a time as the problematic behavior?

Supplementary explanation

  • CBCentralManager is held as a property and the instance is not released when the dialog is selected in the problem behavior.
  • CBManagerState of CBCentralManager is .poweredOn and CBManager.authorization is .notDetermined in centralManagerDidUpdateState during problem behavior.
centralManagerDidUpdateState is not called after user selection in Bluetooth permissions dialog
 
 
Q