NordicSemiconductor/Flutter-nRF-Connect-Device-Manager

Bluetooth Permission Request on IOS pop up as soon as app is opened even when library is not even configured.

Closed this issue · 2 comments

Steps to reproduce:

  • Use flutter create to create a new flutter project.

  • Add in your info.plist permissions such as:
    NSLocationWhenInUseUsageDescription
    APP needs location when in use
    NSLocationUsageDescription
    APP needs location when in use
    NSLocationAlwaysAndWhenInUseUsageDescription
    APP needs access to location in order to track outside workouts.
    NSLocationAlwaysUsageDescription
    APP needs access to location in order to track outside workouts.
    NSBluetoothPeripheralUsageDescription
    App uses Bluetooth to find and connect to devices
    NSBluetoothAlwaysUsageDescription
    App uses Bluetooth to find and connect to devices

  • Include mcumgr_flutter into your project.

  • Run the project.

  • (NO Implementation is required, just by the fact of having mcumgr_flutter in pubspec.yaml it will prompt the modal permission as soon as start up(splash screen) of the app for the first time)

  • If you comment mcumgr_flutter in pubspec.yaml permission is not longer requested.

As soon as opened a project with just the fact of having mcumgr_flutter added as a dependency in your pubspec.yaml file, as soon as you run iOS Flutter a permission for Bluetooth is displayed.

This is inconvenient due it forces developers using this library into a workflow without control of when to require or ask a user for such permission.

And this is even worst when you have other permissions that need to pop as soon as the app is opened, such as login using a web browser, because the permission shows super fast providing a bad UX experience.

I would expect this behavior if I am implementing or calling any methods of this library, but not just by simply adding into the project pubspec.yaml, it should not "Auto run" a permission request when any project is launched for the first time, and the documentation does not mention anything about it neither.

This is not replicable on Android.

Hi @jchirinosodio

Sorry for the delay.
I've just fixed that. You can check the latest release (0.4.1).

I hope that is what you expected.

This is super awesome! Thank you so much @NickKibish, really excited to test it out!