flutterlocation icon indicating copy to clipboard operation
flutterlocation copied to clipboard

PermissionStatus.grantLimited not returns on Android 12+ (31 SDK)

Open KirillArtemenko opened this issue 2 years ago • 2 comments

On Android 12 (API level 31) or higher user can grant only approximate location

2022-06-07_09-25-00

When only approximate location access granted system returns only ACCESS_COARSE_LOCATION without ACCESS_FINE_LOCATION and plugin return PermissionStatus.denied instead of PermissionStatus.grantedLimited.

I found simple hack in this case When user selecting Approximate location and plugin returns PermissionStatus.denied by first time — I check this is Android 12+ and then i request permissions one more time. After that system requesting allow app to access device precise location.

2022-06-07_09-26-34

If user accepted it — plugin returns PermissionStatus.granted and app starting to get location data.

Please fix it in near updates.

KirillArtemenko avatar Jun 07 '22 06:06 KirillArtemenko

https://pub.dev/packages/geolocator handles this properly

GabrielBB avatar Jul 06 '22 19:07 GabrielBB

Any news?

lotaviods avatar Oct 24 '23 22:10 lotaviods