Sunday 11 July 2021

Xamarins forms Geolocalisation does not work on android real device but woks on emulator

I am trying to implement xamarin essential Geolocalisation.

I would like to get the latitude and longitude of the phone

I Have followed the Microsoft tutorial. It works on emulator and works on physical device when deployed from Visual studio, but it does not work when downloaded from Google Play (Android version 8,9,10)

Here is my code :

var request = new GeolocationRequest(GeolocationAccuracy.Medium, TimeSpan.FromSeconds(10));

Location location = await Geolocation.GetLocationAsync(request);
    
if (location != null)
{
    GetLocation(location);
}else{
    Console.WriteLine("not working");
}


from Xamarins forms Geolocalisation does not work on android real device but woks on emulator

No comments:

Post a Comment