Get network based location at set intervals and send it to a server.
Cordova
Add plugin to project
cordova plugin add <path>/cordova-plugin-background-network-location
var locationService = window.backgroundNetworkLocation;
// Set config options
locationService.configure({
url: URL, // Url of server to send location data to
headers: {}, // Optional header
minDistanceMeters: 0, // 0 to disable distance, and just use time
minTime: 300, //In seconds
toasts: false, // Show debug toasts
restartAlreadyRunning: true // Restart location service when calling start() if the service is already running
});
// Start service
locationService.start();
// Get last location
var lastLocation = locationService.getLastLocation();
// Stop service
locationService.stop();
- Dennis Krol - Initial work - denniskrol
This project is licensed under the Do What The Fuck You Want To Public License (WTFPL) - see the LICENSE.md file for details
- Based on cordova-plugin-background-geolocation by mauron85