Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Plugin.Geolocator not returning Latitude/Longitude and no error

$
0
0

Hi,

I am trying to use the Plugin.Geolocator to get the user's current location.

I used below code and it's launching the app with no errors but I am not getting any value for Latitude or Longitude... it's just blank and no error..

This problem is for both iOS simulator and Android Emulator.

protected async override void OnAppearing()
{
    base.OnAppearing();

    var locator = CrossGeolocator.Current;

    locator.DesiredAccuracy = 50;

    var position = await locator.GetPositionAsync();

    LabelLatitude.Text = position.Latitude.ToString();
    LabelLongitude.Text = position.Longitude.ToString();
}

How to fix this please..

Thanks,
Jassim


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>