Baseflow / flutter-permission-plugins

This repo contains a collection of permission related Flutter plugins which can be used to request permissions to access device resources in a cross-platform way.
https://baseflow.com
MIT License
52 stars 34 forks source link

[android] checkPermissionStatus returns PermissionStatus.denied even when not asked for permission #34

Closed agordeev closed 4 years ago

agordeev commented 4 years ago

🐛 Bug Report

The library doesn't provide an unified API across iOS and Android.

On iOS, it returns PermissionStatus.unknown when not asked for permission.

On Android, it returns PermissionStatus.denied, so it is impossible to say whether we asked for permission and the user declined to grant it, or we didn't ask at all.

Configuration

Version: 2.0.4+1

Platform:

mvanbeusekom commented 4 years ago

Yes this is correct, unfortunately this is how permissions are implemented by Android. Google automatically assumes permissions are denied until the user explicitly grants your app permissions. Unlike iOS where permissions are unknown until the user explicitly grants or denies the app permissions.

Our permission_handler plugin tries to solve this be keeping a record on the Android device and over a better cross-platform interface.