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
- Instantiation of
CBCentralManager - Bluetooth authorization dialog appears on the screen
- Select "Allow" in the permission dialog
- After selection,
centralManagerDidUpdateStateis called CBManager.authorizationbecomes .allowedAlways
Problem behavior
- Instantiation of
CBCentralManager - Bluetooth authorization dialog appears on screen
centralManagerDidUpdateStateis called before selection- Select "Allow" in the authorization dialog
- After selection,
centralManagerDidUpdateStateis not called
What could cause the centralManagerDidUpdateState to be called at such a time as the problematic behavior?
Supplementary explanation
CBCentralManageris held as a property and the instance is not released when the dialog is selected in the problem behavior.CBManagerStateofCBCentralManageris .poweredOn andCBManager.authorizationis .notDetermined incentralManagerDidUpdateStateduring problem behavior.