Essentials: on iOS 14 the "Allow Location" prompt is show very briefly, then it instantly goes away before I'm able to click "Use location while in App"

Created on 2 Nov 2020  路  9Comments  路  Source: xamarin/Essentials

What I'm seeing is when requesting location, on iOS 14 the "Allow Location" prompt is show very briefly, then it instantly goes away before I'm able to click "Use location while in App"

Is this issue related? Below is my simple code. Wasn't sure if its somehow related to this:

https://stackoverflow.com/questions/7888896/current-location-permission-dialog-disappears-too-quickly
https://github.com/xamarin/Essentials/issues/1066

     while (true)
                {
                    if (await Permissions.CheckStatusAsync<Permissions.LocationWhenInUse>() == PermissionStatus.Granted)
                       break;

                    await AppHelper.RequestAsync_Fixed<Permissions.LocationWhenInUse>();
                }

                var request = new GeolocationRequest(GeolocationAccuracy.Medium)
                {
                    Timeout = TimeSpan.FromSeconds(30)
                };

                var location = await Geolocation.GetLocationAsync(request);

Video showing the issue:

https://streamable.com/3o51ah

_Originally posted by @aherrick in https://github.com/xamarin/Essentials/issues/1390#issuecomment-718288385_

need-more-information

All 9 comments

This will probably be fixed once we merge https://github.com/xamarin/Essentials/pull/1487

Then you won't need to use this code as either.

@mattleibow awesome thanks for the response! once the new version is pushed i'll update and try it out. if its successful i'll close this puppy out. 馃憤

You can test the fix in the nuget from the artifacts here:
https://dev.azure.com/xamarin/public/_build/results?buildId=30010&view=results

I'm going to just make sure that VS2017 is not broken with this, and then I'll merge and then the build will go out to the preview feed: https://aka.ms/xamarin-essentials-ci/index.json

@mattleibow hi! is this part of the beta 3 release that just dropped? if so i'm not seeing the issue fixed :(

when i keep this code in

  while (true)
                {
                    if (await Permissions.CheckStatusAsync<Permissions.LocationWhenInUse>() == PermissionStatus.Granted)
                       break;

                    await AppHelper.RequestAsync_Fixed<Permissions.LocationWhenInUse>();
                }

It actually flashes like the prompt is going to go away once, then it actually remains. so technically this could be used as as work around i think, but it still seems fishy. any thoughts? thank you!

I believe it was fixed. Are you able to submit a small repro case?

I tested on my device and it stays available until I tap it. And now it also no longer hangs on iOS 14.

I'll look to submit a small repo case and see if I see it there. thanks!

@aherrick Did you manage to get a repro case? I just tested on iOS 10 and iOS 14, the pop up stays around until I tap something.

@mattleibow thanks for checking back! Actually I was able to get this resolved things are looking good on the latest build! I'm closing this for now. cheers.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RogerSchmidlin picture RogerSchmidlin  路  4Comments

Agredo picture Agredo  路  3Comments

janusw picture janusw  路  4Comments

craylward picture craylward  路  4Comments

nicolgit picture nicolgit  路  4Comments