Commit 28f56852 authored by Chris Scott's avatar Chris Scott

Modify SampleApp config

parent 2bc77307
...@@ -142,6 +142,8 @@ var app = { ...@@ -142,6 +142,8 @@ var app = {
* This would be your own callback for Ajax-requests after POSTing background geolocation to your server. * This would be your own callback for Ajax-requests after POSTing background geolocation to your server.
*/ */
var yourAjaxCallback = function(response) { var yourAjaxCallback = 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(); bgGeo.finish();
}; };
...@@ -181,19 +183,14 @@ var app = { ...@@ -181,19 +183,14 @@ var app = {
// BackgroundGeoLocation is highly configurable. // BackgroundGeoLocation is highly configurable.
bgGeo.configure(callbackFn, failureFn, { bgGeo.configure(callbackFn, failureFn, {
url: 'http://only.for.android.com/update_location.json', // <-- Android ONLY: your server url to send locations to desiredAccuracy: 0, // <-- 0: highest power, highest accuracy; 1000: lowest power, lowest accuracy.
params: {
auth_token: 'user_secret_auth_token', // <-- Android ONLY: HTTP POST params sent to your server when persisting locations.
foo: 'bar' // <-- Android ONLY: HTTP POST params sent to your server when persisting locations.
},
desiredAccuracy: 0,
stationaryRadius: 50, stationaryRadius: 50,
distanceFilter: 50, distanceFilter: 50, // <-- minimum distance between location events
notificationTitle: 'Background tracking', // <-- android only, customize the title of the notification activityType: 'AutomotiveNavigation', // <-- [ios]
notificationText: 'ENABLED', // <-- android only, customize the text of the notification locationUpdateInterval: 30000, // <-- [android] minimum time between location updates, used in conjunction with #distanceFilter
activityType: 'AutomotiveNavigation', activityRecognitionInterval: 10000, // <-- [android] sampling-rate activity-recognition system for movement/stationary detection
debug: true, // <-- enable this hear sounds for background-geolocation life-cycle. debug: true, // <-- enable this hear sounds, see notifications during life-cycle events.
stopOnTerminate: false // <-- enable this to clear background location settings when the app terminates stopOnTerminate: false // <-- enable this to clear background location settings when the app terminates
}); });
// Turn ON the background-geolocation system. The user will be tracked whenever they suspend the app. // Turn ON the background-geolocation system. The user will be tracked whenever they suspend the app.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment