Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Getting geolocation in xamarin forms
try
{
var location = await Geolocation.GetLastKnownLocationAsync();
if (location != null)
{
Console.WriteLine($"Latitude: {location.Latitude}, Longitude: {location.Longitude}, Altitude: {location.Altitude}");
}
}
catch (Exception ex)
{
// Unable to get location
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.