pmwisdom/cordova-background-geolocation-services

Frequency of updates

Opened this issue · 5 comments

Hi, I've set the following configuration, which is currently retrieving the location every 5 minutes.

bgLocationServices.configure({ desiredAccuracy: 50, distanceFilter: 700, debug: true, interval: 300000, useActivityDetection: false, notificationTitle: 'BG Plugin', notificationText: 'Tracking', fastestInterval: 300000 });

I've set the distance filter to 700 metres, I drove over 10 miles and noticed the location would only update every 5 minutes (as per the 300000 millisecond interval) but I was travelling on average 60MPH so I definitely covered more than 700 metres in 5 minutes.

I understand the interval is there to prevent updates occurring before the interval has elapsed, how could I set the configuration so I receive a location update when the user moves more than 700 metres? If I lower the interval, I receive updates even if I have not moved.

Thanks for any help.

Need a little more information, what platform is this on? Android / iOS, both?

Hi Paul, this is on iOS 10.3.2

@SeanHub Yeah perhaps I should put this in the docs but the distance filter really doesn't do anything on iOS because to preserve battery i'm shutting off the GPS between your interval, so essentially the location manager probably loses the last location that you had, which means no distance calculation.

If you wan't to stop updates while your still, you can try using the activity detection module (useActivityDetection = true).

Thanks for the explanation. I presume the distance filter works as expected on Android?

When I enable useActivityDetection, I receive a location update everytime I move my phone (even though the interval is 5 minutes). Is this expected functionality?