Baseflow / flutter-permission-handler

Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
https://baseflow.com
MIT License
2.05k stars 858 forks source link

Status of permission is Denied after choose approximately location in request permission dialog #984

Open thao-vu-0106 opened 1 year ago

thao-vu-0106 commented 1 year ago

🐛 Bug Report

In android 12 or higher, when request both ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION will show dialog to choose precise location or approximate location. Screen Shot 2023-01-30 at 11 06 48

when choose approximate location, the apps will grant only ACCESS_COARSE_LOCATION. image

But the constant Permission.location in permission_handler will be "isGranted" only both ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION are allowed. image

link reference: https://developer.android.com/training/location/permissions

After request permission location, i will get current location when granted and show dialog for user when the permission is denied. Because of above problem, when i choose approximate location, the app always show the dialog rather than requesting permission.

Expected behavior

Reproduction steps

Configuration

Platform:

enricocaliolo commented 1 year ago

I am having the same issue. I noticed that, when choosing approximate location, the permission returns as PermanentlyDenied, which is not the expected behaviour, as, at least my app, could still work with only approximate location.

Also, I don't see a way, in this package, to handle the dialog that asks you to change to precise location or to change to approximate location, after choosing approximate location in the first permission dialog. Choosing to keep approximate location still leaves the permission as PermanentlyDenied. This dialog appears two times before not appearing anymore, so there is not a rationale for it either.

image

Robbinb1993 commented 1 year ago

I have the same problem for coarse (approximate) location. Any update on this issue?

kostov commented 1 year ago

There is need to know which location (approximate or precise) was selected due to some functionality depends on it. For example, network_info_plus will do not work correctly if approximate location permission is granted. Right now, if approximate location permission is granted by end-user, Permission.locationWhenInUse.status == PermissionStatus.denied on Android, but == PermissionStatus.granted on iOS.

JeroenWeener commented 1 year ago

Related to #559

wojciechzahradnikdeviniti commented 1 year ago

Hi, any updates?

idealgeek007 commented 4 months ago

Any update on this ? I'm facing the same issue image image

wujek-srujek commented 3 months ago

There is need to know which location (approximate or precise) was selected due to some functionality depends on it.

@kostov Interesting, I've just opened a feature request asking for exactly this, see https://github.com/Baseflow/flutter-permission-handler/issues/1356 and vote ;>

Hoai-Phong commented 2 months ago

@idealgeek007 same image