GeolocatorPlugin
GeolocatorPlugin copied to clipboard
GeoLocator Listening issue
I have one issue is geo Locator that I have declared Time as 10 sec. then also in Android: it updates after 10 or more than 10 sec., In IOS: it updates in every sec. This is my Code:
public async void CurrentLocation()
{
try
{
await CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromSeconds(10), 0, true, new
Plugin.Geolocator.Abstractions.ListenerSettings
{
ActivityType = Plugin.Geolocator.Abstractions.ActivityType.AutomotiveNavigation,
AllowBackgroundUpdates = true,
DeferLocationUpdates = true,
DeferralDistanceMeters = 1,
//DeferralTime = TimeSpan.FromSeconds(10),
ListenForSignificantChanges = false,
PauseLocationUpdatesAutomatically = false
});
count++;
CrossGeolocator.Current.PositionChanged += changedPosition;
}
Please give me some solution. Thanks in Advance.
Regarding the code https://github.com/jamesmontemagno/GeolocatorPlugin/blob/master/src/Geolocator.Plugin/Apple/GeolocatorImplementation.apple.cs#L369 the minimumTime is not implemented in iOS (at least not yet).
Possible workaround in Xamarin Form: GeoLocator Issue