While using Xamarin.Mobile.Geolocator I've come across an odd bug that seems to be blocking me from resolving the Task. For example:
var locator = new Geolocator ();
if (locator.IsGeolocationAvailable) {
Console.WriteLine ("Location Available");
var task = locator.GetPositionAsync (10000);
Console.WriteLine ("Task Created");
var position = task.Result;
Console.WriteLine ("Position Status: {0}", position.Timestamp);
Console.WriteLine ("Position Latitude: {0}", position.Latitude);
Console.WriteLine ("Position Longitude: {0}", position.Longitude);
} else {
Console.WriteLine ("newp");
}
This function eventually times out on task.Result. I've attempted to debug this by setting the info.plist
NSLocationAlwaysUsageDescription
and NSLocationWhenInUseUsageDescription
params, changing it to .ContinueWith
lambda, tested on simulator and actual device, set timeout to 100 seconds, but it always seems to crash on timeout.
Is this a problem with my implementation or a bug in Xamarin.Mobile? I would like to continue with Xamarin.Mobile, but I'm not opposed to reverting back to native implementation.
Thanks