Commit 6760a843 authored by Chris Scott's avatar Chris Scott

Cleanup code, refactor algorithms for similarity to Android. Add new ios-only...

Cleanup code, refactor algorithms for similarity to Android.  Add new ios-only @config activityType.  Having problems with latest ios 7.1 and turning on aggressive tracking from a stationary-region exit; seems to work on iphone5 still
parent 2d69f9e5
......@@ -77,6 +77,7 @@ A full example could be:
desiredAccuracy: 10,
stationaryRadius: 20,
distanceFilter: 30,
activityType: "AutomotiveNavigation",
debug: true // <-- enable this hear sounds for background-geolocation life-cycle.
});
......@@ -162,6 +163,17 @@ Compare now background-geolocation in the scope of a city. In this image, the l
![distanceFilter at city scale](/distance-filter-city.png "distanceFilter at city scale")
### iOS-only Config
#####`@param {String} activityType [AutomotiveNavigation, OtherNavigation, Fitness, Other]`
Presumably, this affects ios GPS algorithm. See [Apple docs](https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html#//apple_ref/occ/instp/CLLocationManager/activityType) for more information
### Android-only Config
#####`@param {Integer} locationTimeout
The minimum time interval between location updates, in seconds. See [Android docs](http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(long,%20float,%20android.location.Criteria,%20android.app.PendingIntent)) for more information.
## Licence ##
......
......@@ -98,7 +98,8 @@ var app = {
desiredAccuracy: 10,
stationaryRadius: 20,
distanceFilter: 30,
debug: true // <-- enable this hear sounds for background-geolocation life-cycle.
activityType: "AutomotiveNavigation", // <-- iOS-only
debug: true // <-- enable this hear sounds for background-geolocation life-cycle.
});
// Turn ON the background-geolocation system. The user will be tracked whenever they suspend the app.
......
This diff is collapsed.
......@@ -7,13 +7,14 @@ module.exports = {
distanceFilter = (config.distanceFilter >= 0) ? config.distanceFilter : 500, // meters
locationTimeout = (config.locationTimeout >= 0) ? config.locationTimeout : 60, // seconds
desiredAccuracy = (config.desiredAccuracy >= 0) ? config.desiredAccuracy : 100; // meters
debug = config.debug || false;
debug = config.debug || false,
activityType = config.activityType || "OTHER";
exec(success || function() {},
failure || function() {},
'BackgroundGeoLocation',
'configure',
[params, url, stationaryRadius, distanceFilter, locationTimeout, desiredAccuracy, debug]);
[params, url, stationaryRadius, distanceFilter, locationTimeout, desiredAccuracy, debug, activityType]);
},
start: function(success, failure, config) {
exec(success || function() {},
......@@ -66,4 +67,4 @@ module.exports = {
'getStationaryLocation',
[]);
}
};
};
\ No newline at end of file
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