-
-
Notifications
You must be signed in to change notification settings - Fork 744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] [checkState] Always returns 'unknown' #1196
Comments
I do have await, same as in your screenshot. |
I have same ISSUE!! |
I think this function doesn't guarantee completion. so need to check the state of BleManagerDidUpdateState await BleManager.start();
|
Make sure to call functions just after start method cause ble manager needs to have CBCentralManager instance ready to do proper work, see: https://github.com/innoveit/react-native-ble-manager/blob/master/ios/BleManager.swift There's the behaviors: checkState(imperative): Gives the current state even if it's not ready will report unknown asap. BleManagerDidUpdateState(Event driven): As soon CBCentralManager is ready with start to report changes |
Describe the bug
On iOS, using bleManager.checkState() always returns 'unknown'. I tried with Bluetooth permissions granted/ not granted, and with Bluetooth on/ off.
Smartphone (please complete the following information):
Additional context
However, the listener for BleManagerDidUpdateState is receiving the correct state ['unauthorized', 'off', 'on'].
Also, on Android bleManager.checkState() returns the correct state.
The text was updated successfully, but these errors were encountered: