flutter-permission-handler icon indicating copy to clipboard operation
flutter-permission-handler copied to clipboard

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

Open thao-vu-0106 opened this issue 2 years ago • 8 comments

🐛 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

  • The value of Permission.location should be granted

Reproduction steps

  • choose approximate location when request location then observe the status of Permission.location

Configuration

  • Android 12 or higher Version: 10.0.1

Platform:

  • [ ] :iphone: iOS
  • [x] :robot: Android

thao-vu-0106 avatar Jan 30 '23 04:01 thao-vu-0106

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

enricocaliolo avatar May 24 '23 14:05 enricocaliolo

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

Robbinb1993 avatar Aug 15 '23 14:08 Robbinb1993

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.

kostov avatar Aug 17 '23 04:08 kostov

Related to #559

JeroenWeener avatar Aug 30 '23 08:08 JeroenWeener

Hi, any updates?

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

idealgeek007 avatar Jul 06 '24 15:07 idealgeek007

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 ;>

wujek-srujek avatar Aug 09 '24 20:08 wujek-srujek