Xamarin.Essentials Geolocation not working in iOS simulator?

Stesvis 1,041 Reputation points
2021-03-08T01:00:55.173+00:00

Is it a known behavior that in Xamarin Forms, iOS simulator, this always returns null?

var location = await Geolocation.GetLocationAsync(request, cts.Token);

In Android it returns a value also on the emulator but in iOS i always get NULL. I haven't had a chance to test on a real iOS device yet.

Thanks

Developer technologies .NET Xamarin
0 comments No comments
{count} votes

Accepted answer
  1. Cole Xia (Shanghai Wicresoft Co,.Ltd.) 6,756 Reputation points
    2021-03-08T06:28:58.49+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Try to set location in Simulator Settings .

    75247-capture.png


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.