Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maxDaysToPersist setting #38

Closed
icelandgrecian opened this issue Apr 7, 2020 · 3 comments
Closed

maxDaysToPersist setting #38

icelandgrecian opened this issue Apr 7, 2020 · 3 comments

Comments

@icelandgrecian
Copy link

I was looking at this code and I see that maxDaysToPersist isn´t set in the configuration in the tracking.js and I was just writing to double check something.

https://transistorsoft.github.io/react-native-background-geolocation/interfaces/_react_native_background_geolocation_.config.html

This plugin which is the basis for the location tracking says that the default for maxDaysToPersist is 1 day and this link suggests that 'The only way that locations are destroyed from the database are 1 of 4 including' : 'maxDaysToPersist elapses and the location is destroyed.'

https://transistorsoft.github.io/cordova-background-geolocation-lt/interfaces/_cordova_background_geolocation_lt_.httpevent.html

Hopefully I am wrong in this assumption but thought was worth double checking this as I thought the app was supposed to record 14 days worth of locations

@jeremybarbet
Copy link
Contributor

If I'm not mistaking you are looking at the wrong documentation.

The package's documentation can be found here https://github.com/mauron85/react-native-background-geolocation.

It looks to store all locations by default with a threshold of 10000 according to maxLocations props and then locations are filtered to get only the last 14 days https://github.com/aranja/rakning-c19-app/blob/master/src/tracking.js#L66

@eirikurn
Copy link
Member

eirikurn commented Apr 8, 2020

@jeremybarbet is correct. In our calculations, 10.000 should well cover 14 days, since we only get location updates when the user is on the move. We should probably set maxLocations explicitly though.

@icelandgrecian
Copy link
Author

@eirikurn @jeremybarbet - Yeah, I was looking at the wrong documentation, I had done some playing with this other component before and assumed they were related!

I agree, it would be better to set maxLocations explicitly to make it clearer what´s happening here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants