* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
varENV=(function(){
varlocalStorage=window.localStorage;
...
...
@@ -132,8 +142,6 @@ var app = {
* 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();
};
...
...
@@ -176,10 +184,15 @@ var app = {
bgGeo.configure(callbackFn,failureFn,{
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.