-
Notifications
You must be signed in to change notification settings - Fork 505
[Bug] Android 12: "Approximate" Location Permissions Returns Denied #1912
Comments
This seems to be the problem:
When the Permission request is being made for Android.Permission.COARSE and Android.Permission.FINE, they are now individual permissions. When the user selects "Approximate", then COARSE returns I'm not sure what the thought process behind denying the entire request was, so I'm not sure what the next step is. @jfversluis, any idea? Oh, and sorry this boomeranged back to you :) |
Hey @SharpMobileCode! Thanks for the report and helping with the investigation. Don't worry about getting this on my plate 😄 I'm looking into this now, hoping to have something soon. So my thinking is that in the case of the locations we should add a different path here then that check if either of those is @aritchie pinging you as well as you had some input on this? |
@jfversluis I'm looking into sending a PR. There are a few issues with permissions around this. The LocationAlways is even more bugged FYI ;) Android 12 introduced the ability for the user to deny fine location, but instead grant coarse in its place. |
Awesome! Appreciate it! I'll be waiting for that PR or let me know if you can't do it so I can take over :) |
Thank you both! I think this may also fix #1871 if I'm following the code path correctly. |
In the meantime, people can just set their targets as android 10. You don't need to be on the latest target for Xamarin Forms and most xamarin libs right now. |
That's good to know! Just one thing to be aware of. Google Play is now requiring targeting API Level 30 (Android 11) for existing apps starting this month for app updates. |
@aritchie let me know if you're still looking into this. Else I will be in the near future :) |
@jfversluis Sorry about that, I forgot all about this. I've got this fixed up in Shiny, so I can bring it here. There is a couple of things to discuss here as the issue is bigger as it includes issues with LocationAlways as well. The current architecture is limiting and requires a number of changes to support the way android does batches of permissions now. Let me know if you agree with the following:
|
Fix #1912 - if coarse is provided instead of fine location, returned …
As I see you use |
Description
On an Android 12 device or emulator, the
Permissions.RequestAsync<Permissions.LocationWhenInUse>()
call returnsPermissionStatus.Denied
when user selects "Approximate" location. It should returnPermissionStatus.Granted
Steps to Reproduce
Expected Behavior
Returns
PermissionStatus.Granted
Actual Behavior
Returns
PermissionStatus.Denied
Basic Information
Reproduction Link
https://github.com/SharpMobileCode/Android12XamEssentialsBug
The text was updated successfully, but these errors were encountered: