You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 15, 2024. It is now read-only.
If you request LocationWhenInUse permission targeting Android 12, it shows a nice pop-up, where you can select the precision of the permission you want to grant. Either Approximate (coarse) or Precise (fine).
If you only allow Approximate, the CheckAsync will always return "Denied" status, even though permission was granted.
@Cheesebaron would you be able to test the resulting NuGet from the linked PR and see if that has the desired result? If so, I can add it to the next release I want to put out this week/early next week.
Description
If you request LocationWhenInUse permission targeting Android 12, it shows a nice pop-up, where you can select the precision of the permission you want to grant. Either Approximate (coarse) or Precise (fine).
If you only allow Approximate, the CheckAsync will always return "Denied" status, even though permission was granted.
There is no way of defining what you want.
Both fine and coarse is requested:
https://github.com/xamarin/Essentials/blob/main/Xamarin.Essentials/Permissions/Permissions.android.cs#L232-L233
Seems like it happens in this part of the code when checking permissions: https://github.com/xamarin/Essentials/blob/main/Xamarin.Essentials/Permissions/Permissions.android.cs#L82
You simply just return the status of the first, even though there might be other permissions that have been granted.
Steps to Reproduce
android:targetSdkVersion="31"
and TFM to 12 or higherawait Permissions.CheckStatusAsync<Permissions.LocationWhenInUse>();
PermissionStatus
will always be "Denied" if you selected approximate location when requstingExpected Behavior
Some kind of granularity to know which of the two requested permissions in
LocationWhenInUse
have been permitted by the user.Actual Behavior
PermissionStatus
isDenied
if "Approximate" is selectedBasic Information
Screenshots
Reproduction Link
The text was updated successfully, but these errors were encountered: