GeofenceManager.RequestAccess() Does Not Request LocationAlways on Android - found cause of this on Android developer site #1575
rokmeglic71
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I’ve noticed that when calling GeofenceManager.RequestAccess() from the Shiny library, it does not request LocationAlways permission on Android, unlike iOS.
Behavior Observed
On iOS
When the user grants location permission, checking the app settings confirms that the permission is set to "Always", with Precise Location enabled.
On Android
Executing GeofenceManager.RequestAccess(); results in the system prompt displaying only "Allow while using the app".
To explicitly request "Allow always", I have to manually call:
permissionStatus = await Permissions.CheckStatusAsync<Permissions.LocationAlways>();
If not granted, the user is redirected to the App Settings, where they can manually select "Allow all the time".
Question
Is this expected behavior? Am I missing something in the implementation?
Findings
After reviewing Android’s documentation, this behavior appears to be intentional. On Android, background location (ACCESS_BACKGROUND_LOCATION) cannot be requested through a system dialog and must be manually enabled via App Settings.
Just sharing this for anyone else.
P.S: Thank you for the great library!
Beta Was this translation helpful? Give feedback.
All reactions