jamesmontemagno / GeolocatorPlugin

Geolocation plugin for Xamarin and Windows
MIT License
294 stars 158 forks source link

minimumTime vs DeferralTime? #294

Open stesvis opened 5 years ago

stesvis commented 5 years ago

I am trying to understand what the difference is between minimumTime/minimumDistance in:

Task<bool> StartListeningAsync(TimeSpan minimumTime, double minimumDistance, bool includeHeading = false, ListenerSettings listenerSettings = null);

and

DeferralTime/DeferralDistanceMeters in ListenerSettings?

Example

How often is the PositionChangedevent fired in this scenario?

await CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromMinutes(60), 500, true, new ListenerSettings
{
    ActivityType = ActivityType.AutomotiveNavigation,

    DeferLocationUpdates = true,
    DeferralDistanceMeters = 200,
    DeferralTime = TimeSpan.FromMinutes(20),
});

Is it every 60 minutes or 500 meters whichever comes first? Or is it every 20 minutes/200 meters whichever comes first?

Thanks