question

Stesvis-5434 avatar image
0 Votes"
Stesvis-5434 asked PradipManna-5023 commented

Xamarin.Essentials Geolocation not working in iOS simulator?

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

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ColeXia-MSFT avatar image
0 Votes"
ColeXia-MSFT answered PradipManna-5023 commented

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.



capture.png (68.4 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you that worked!
How can I set the same on a Mac? I can't find the option...

0 Votes 0 ·

Open Simulator -> Feature -> Location .

1 Vote 1 ·

Thank God. This helps me hehe.

0 Votes 0 ·

Sorry if my question looks silly. I can't find that 'Choose a location' option. I must be doing something wrong, no? I'm developing on Windows11 and my simulator ver is iPhone 13 pro max iOS 15.2.

0 Votes 0 ·