GeolocatorPlugin icon indicating copy to clipboard operation
GeolocatorPlugin copied to clipboard

GeoLocator Listening issue

Open abhay081994 opened this issue 6 years ago • 1 comments

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.

abhay081994 avatar Sep 20 '18 13:09 abhay081994

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

fedemkr avatar Sep 20 '18 18:09 fedemkr