I have been given the task to add location tracking in an ionic 3 app.I have checked cordova geolocation plugin , the watchPosition() method works but there is no option to add an interval such that after an interval of x seconds the location data is obtained.In the plugin the max interval is only 1 second which is default and cannot be changed.Are there any other plugins where interval could be added?
I’ll share the requirements given to me to for more information.
- After user logs in we should track their current login location i.e lat/lng
- User location should be tracked after every xx mins which is configured in the their profile
- If user has no network, location info to be stored locally and sent after they get the network
- Tracking should be stopped after a specified time as given in their profile ex: if for a user it could be 8 hours of working, this time is sent when they log in to the app from server
- If app is closed stop the tracking
- In app closing call an API to inform that app is closed by the user
Can anyone help me with the interval for location tracking and also storing location when there is no network(as in how to detect absence of network connection programatically)?