* This would be your own callback for Ajax-requests after POSTing background geolocation to your server.
*/
varyourAjaxCallback=function(response){
// NB: It's important to inform BackgroundGeolocation when your callback is complete so it can terminate the native background-process which is currently running your callback.
// If you fail to execute #finish, the OS might kill your app for leaving a background-process running.
bgGeo.finish();
};
...
...
@@ -174,15 +172,28 @@ var app = {
// BackgroundGeoLocation is highly configurable.
bgGeo.configure(callbackFn,failureFn,{
debug:true,// <-- enable this hear sounds for background-geolocation life-cycle.
desiredAccuracy:0,
stationaryRadius:50,
distanceFilter:30,
locationUpdateInterval:30000,
distanceFilter:50,
locationUpdateInterval:5000,
activityRecognitionInterval:10000,
stopTimeout:0,// <-- Minutes to wait before turning off GPS after stop-detection.
stopTimeout:1,
forceReload:true,// <-- If the user closes the app **while location-tracking is started** , reboot app (WARNING: possibly distruptive to user)
activityType:'AutomotiveNavigation',
debug:true,// <-- enable this hear sounds for background-geolocation life-cycle.
stopOnTerminate:false// <-- enable this to clear background location settings when the app terminates
stopOnTerminate:false// <-- Allow the background-service to run headless when user closes the app.
/**
* HTTP Feature: set an url to allow the native background service to POST locations to your server