EJ-5254 avatar image
0 Votes"
EJ-5254 asked WenyanZhang-MSFT edited

Xamarin Forms Geolocation.GetLocationAsync on iOS hangs and never returns?


Trying to implement location tracking in our app:

var request = new GeolocationRequest( GeolocationAccuracy.Medium, TimeSpan.FromSeconds( 10 ) );
Location location = await Geolocation.GetLocationAsync( request );

Above works on Android, but hangs in iOS and never returns in GetLocationAsync line. Testing on iPhone 13 Pro, location is enabled and permission is given to the app. Also have following keys in Info.plist file:

 <string>Jim2 app needs access to location for Location tracking</string>
 <string>Jim2 app needs access to location while in background.</string>
 <string>Jim2 app needs access to location for Location tracking</string>

Any ideas?

· 1
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.

Hi @EJ-5254 , I'm not sure if you are testing the location in background mode. You mean the location will never have a value, or it gets the value once then it never returns? And would you mind sharing the Essentials version and your iOS version? I test on iOS 15.4 iPhone13 device, I have to say, I can't reproduce your issue. Would you mind sharing more information?
If you want to get the location in background mode, see:

0 Votes 0 ·

0 Answers