0

I am developing a flutter app that requires bluetooth. If bluetooth does not work, the app das no purpose.

I am using the library flutter_reactive_ble.

This library communicates the status of the device bluetooth using the BleStatus enum.

The potential values are as follows...

poweredOff
ready
unauthorized
unknown
unsupported

I am trying to determime my course of action for each of these status. For example...

poweredOff - tell user to turn on bluetooth
ready - good to go
unauthorized - ??
unknown - keep waiting till determined
unsupported - tell user app won't work on their device

I am not quite sure what to do on unauthorized. I am also not quite sure what unauthorized means. Does this mean that the app did not set the right permission at the platform level? For example, maybe the dev did not add the right permissions to AndroidManifest.xml. Or does it mean that I have to prompt the user to accept some permissions?

1 Answer 1

1

By refering to the package's documentation BleStatus.unauthorized means that bluetooth usage is not authorized for this application which means that the user refuses the bluetooth permission when it was asked.

You could ask your user to authorize bluetooth usage for the application in its phone's settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.