* or more contributor license agreements. See the NOTICE file
* All rights reserved.
* distributed with this work for additional information
* sales@transistorsoft.com
* regarding copyright ownership. The ASF licenses this file
* http://transistorsoft.com
* to you under the Apache License, Version 2.0 (the
* @see LICENSE
* "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(){
varENV=(function(){
varlocalStorage=window.localStorage;
varlocalStorage=window.localStorage;
...
@@ -132,8 +142,6 @@ var app = {
...
@@ -132,8 +142,6 @@ 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.
*/
*/
varyourAjaxCallback=function(response){
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();
bgGeo.finish();
};
};
...
@@ -176,10 +184,15 @@ var app = {
...
@@ -176,10 +184,15 @@ var app = {
bgGeo.configure(callbackFn,failureFn,{
bgGeo.configure(callbackFn,failureFn,{
desiredAccuracy:0,
desiredAccuracy:0,
stationaryRadius:50,
stationaryRadius:50,
distanceFilter:30,
distanceFilter:50,
locationUpdateInterval:30000,
locationUpdateInterval:5000,
activityRecognitionInterval:10000,
activityRecognitionInterval:10000,
stopTimeout:0,// <-- Minutes to wait before turning off GPS after stop-detection.