-
Notifications
You must be signed in to change notification settings - Fork 505
[Bug] Approximate location on Android 12 doesn't work correct. #1972
Comments
I'm seeing the same issue as you when users select "Approximate" location. The permission status comes back as Restricted, which is expected. But when we perform a I'm just taking a guess here looking at the code, but I think this line:
might need to be checking for Current Code if (status != PermissionStatus.Granted)
throw new PermissionException($"{typeof(TPermission).Name} permission was not granted: {status}"); Proposed Change? if (status != PermissionStatus.Granted && status != PermissionStatus.Restricted)
throw new PermissionException($"{typeof(TPermission).Name} permission was not granted: {status}"); Thoughts anyone? cc: @jfversluis |
@SharpMobileCode I see you have a analysis and proposal already, would you be willing and able to put it in a PR? You should be able to then also test if it actually fixes it for you :) |
@jfversluis yup. I only changed the permission requests, not any of the gatekeeper methods. I just sent a PR for this: #1976 I would appreciate if the users in this issue test it please. |
I'll check it out this evening (CST) and will let you all know. Thank you! |
Let me know if you got around to this @SharpMobileCode thanks! |
@jfversluis Thanks! Yeah, I pulled down the PR and was able to compile locally. But when I integrate the new binaries into the project I'm working on, I'm getting compile errors in my code saying that it can't find |
Okay, I've got it integrated into my app now (using project references instead) and it doesn't appear to work as expected. Currently running through the debugger trying to figure some stuff out. Thanks! |
Okay, now it seems that when the user selects "Approximate Location", the
to
is never invoked from the listener. So it just kind of freezes there. However, if the user selects "Precise" location, then everything works as expected. I've only ever used Thanks! |
Thanks for working together on this with us @SharpMobileCode ! I'll look into this asap as well :) |
Fix #1972 - allow restricted permissions for geolocation on android
Description
Can not get the approximate location on android 12 because line (Permissions.EnsureGrantedAsync<Permissions.LocationWhenInUse>()) expected only permissions granted:
Essentials/Xamarin.Essentials/Geolocation/Geolocation.android.cs
Line 40 in 72dda32
Steps to Reproduce
Expected Behavior
Actual Behavior
Basic Information
The text was updated successfully, but these errors were encountered: