moko-permissions icon indicating copy to clipboard operation
moko-permissions copied to clipboard

Fix - Background Location Permissions on Android 11

Open hrodrick opened this issue 1 month ago • 0 comments

Starting on Android 11, background location permission must be requested separately from the foreground location permissions (coarse & fine). Requesting them together causes the operative system to ignore the whole request.

This PR addresses and fixes the issue. This PR addresses #139

Note: The fix was tested on the compose sample module (testing-only changes were not included on this PR)

Docs Link: https://developer.android.com/develop/sensors-and-location/location/permissions/runtime#request-only-foreground

Caution: If your app targets Android 11 (API level 30) or higher, the system enforces this best practice. If you request a foreground location permission and the background location permission at the same time, the system ignores the request and doesn't grant your app either permission.

It is responsibility of the developers to request the permissions in the correct order.

hrodrick avatar Dec 11 '25 20:12 hrodrick