Commit 64a54878 authored by Chris Scott's avatar Chris Scott

conflicts merging old re-factor branch for ios after accepting a few 3rd-party PRs

parents f39d5b14 e7442ca9
...@@ -80,9 +80,10 @@ A full example could be: ...@@ -80,9 +80,10 @@ A full example could be:
desiredAccuracy: 10, desiredAccuracy: 10,
stationaryRadius: 20, stationaryRadius: 20,
distanceFilter: 30, distanceFilter: 30,
debug: true, // <-- enable this hear sounds for background-geolocation life-cycle.
notificationTitle: 'Background tracking', // <-- android only, customize the title of the notification notificationTitle: 'Background tracking', // <-- android only, customize the title of the notification
notificationText: 'ENABLED' // <-- android only, customize the text of the notification notificationText: 'ENABLED', // <-- android only, customize the text of the notification
activityType: 'AutomotiveNavigation',
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. // Turn ON the background-geolocation system. The user will be tracked whenever they suspend the app.
...@@ -193,6 +194,16 @@ Optional HTTP headers POSTed to your server when persisting locations ...@@ -193,6 +194,16 @@ Optional HTTP headers POSTed to your server when persisting locations
On Android devices it is required to have a notification in the drawer because it's a "foreground service". This gives it high priority, decreasing probability of OS killing it. To customize the title and text of the notification, set these options. On Android devices it is required to have a notification in the drawer because it's a "foreground service". This gives it high priority, decreasing probability of OS killing it. To customize the title and text of the notification, set these options.
#####`@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.
### iOS 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
## Licence ## ## Licence ##
The MIT License The MIT License
......
...@@ -95,12 +95,16 @@ var app = { ...@@ -95,12 +95,16 @@ var app = {
auth_token: 'user_secret_auth_token', auth_token: 'user_secret_auth_token',
foo: 'bar' foo: 'bar'
}, },
headers: {
'X-Foo': 'bar'
},
desiredAccuracy: 10, desiredAccuracy: 10,
stationaryRadius: 20, stationaryRadius: 20,
distanceFilter: 30, distanceFilter: 30,
debug: true, // <-- enable this hear sounds for background-geolocation life-cycle.
notificationTitle: 'Background tracking', // <-- android only, customize the title of the notification notificationTitle: 'Background tracking', // <-- android only, customize the title of the notification
notificationText: 'ENABLED' // <-- android only, customize the text of the notification notificationText: 'ENABLED', // <-- android only, customize the text of the notification
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. // Turn ON the background-geolocation system. The user will be tracked whenever they suspend the app.
......
...@@ -68,7 +68,9 @@ public class BackgroundGpsPlugin extends CordovaPlugin { ...@@ -68,7 +68,9 @@ public class BackgroundGpsPlugin extends CordovaPlugin {
} else if (ACTION_CONFIGURE.equalsIgnoreCase(action)) { } else if (ACTION_CONFIGURE.equalsIgnoreCase(action)) {
result = true; result = true;
try { try {
// [params, headers url, stationaryRadius, distanceFilter, locationTimeout, desiredAccuracy, debug]); // Params.
// 0 1 2 3 4 5 6 7 8 8 9
//[params, headers, url, stationaryRadius, distanceFilter, locationTimeout, desiredAccuracy, debug, notificationTitle, notificationText, activityType]
this.params = data.getString(0); this.params = data.getString(0);
this.headers = data.getString(1); this.headers = data.getString(1);
this.url = data.getString(2); this.url = data.getString(2);
......
This diff is collapsed.
...@@ -11,12 +11,14 @@ module.exports = { ...@@ -11,12 +11,14 @@ module.exports = {
debug = config.debug || false, debug = config.debug || false,
notificationTitle = config.notificationTitle || "Background tracking", notificationTitle = config.notificationTitle || "Background tracking",
notificationText = config.notificationText || "ENABLED"; notificationText = config.notificationText || "ENABLED";
activityType = config.activityType || "OTHER";
exec(success || function() {}, exec(success || function() {},
failure || function() {}, failure || function() {},
'BackgroundGeoLocation', 'BackgroundGeoLocation',
'configure', 'configure',
[params, headers, url, stationaryRadius, distanceFilter, locationTimeout, desiredAccuracy, debug, notificationTitle, notificationText]); [params, headers, url, stationaryRadius, distanceFilter, locationTimeout, desiredAccuracy, debug, notificationTitle, notificationText, activityType]
);
}, },
start: function(success, failure, config) { start: function(success, failure, config) {
exec(success || function() {}, exec(success || function() {},
......
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