I am tried to geolocalization with XLas.Forms but the code return null at first line. Must I do something to set up the geolocalization?
This is all I have to get the position:
protected async Task<string> ObtenerLocalizacion() { var localizador = DependencyService.Get<IGeolocator>(); string jsonPosicion = string.Empty; if (localizador.IsGeolocationEnabled) { if (!localizador.IsListening) { localizador.StartListening(1000, 1000); var posicion = await localizador.GetPositionAsync(10000, CancellationToken.None); jsonPosicion = JsonConvert.SerializeObject(posicion); } } return jsonPosicion; }
Answers
https://blog.xamarin.com/geolocation-for-ios-android-and-windows-made-easy/
this can be useful