url: 'http://only.for.android.com/update_location.json', // <-- only required for Android; ios allows javascript callbacks for your http
params: { // HTTP POST params sent to your server when persisting locations.
url: 'http://only.for.android.com/update_location.json', // <-- Android ONLY: your server url to send locations to
params: { // <-- Android ONLY: HTTP POST params sent to your server when persisting locations.
auth_token: 'user_secret_auth_token',
foo: 'bar'
},
headers: { // <-- Android ONLY: Optional HTTP headers sent to your configured #url when persisting locations
"X-Foo": "BAR"
},
desiredAccuracy: 10,
stationaryRadius: 20,
distanceFilter: 30,
...
...
@@ -107,12 +110,24 @@ The plugin works with iOS and Android, however both platforms differ significant
### iOS
*Only* on iOS will the plugin execute your configured ```callbackFn```. You may manually POST the received ```GeoLocation``` to your server using standard XHR.
*Only* on iOS will the plugin execute your configured ```callbackFn```. You may manually POST the received ```GeoLocation``` to your server using standard XHR. iOS ignores the @config params ```url```, ```params``` and ```headers```.
### Android
Android **WILL NOT** execute your configured ```callbackFn```. The plugin manages sync-ing GeoLocations to your server automatically, using the configured ```url```, ```params``` and ```headers```. Since the Android plugin must run as an autonomous Background Service, disconnected from your the main Android Activity (your foreground application), the background-geolocation plugin will continue to run, even if the foreground Activity is killed due to memory constraints. This is why the Android plugin cannot execute the Javascript ```callbackFn```, since your app is not guaranteed to keep running -- syncing locations to the server must be handled by the plugin.
#####`@param {String} url`
The url which the Android plugin will persist background geolocation to
#####`@param {Object} params`
Optional HTTP params POSTed to your server when persisting locations (eg: auth_token)
#####`@param {Object} headers`
Optional HTTP headers POSTed to your server when persisting locations
### Config
Use the following config-parameters with the #configure method: