Commit 17d38d6f authored by Chris Scott's avatar Chris Scott

Update docs

parent 182cd311
...@@ -69,11 +69,14 @@ A full example could be: ...@@ -69,11 +69,14 @@ A full example could be:
// BackgroundGeoLocation is highly configurable. // BackgroundGeoLocation is highly configurable.
bgGeo.configure(callbackFn, failureFn, { bgGeo.configure(callbackFn, failureFn, {
url: 'http://only.for.android.com/update_location.json', // <-- only required for Android; ios allows javascript callbacks for your http url: 'http://only.for.android.com/update_location.json', // <-- Android ONLY: your server url to send locations to
params: { // HTTP POST params sent to your server when persisting locations. params: { // <-- Android ONLY: HTTP POST params sent to your server when persisting locations.
auth_token: 'user_secret_auth_token', auth_token: 'user_secret_auth_token',
foo: 'bar' foo: 'bar'
}, },
headers: { // <-- Android ONLY: Optional HTTP headers sent to your configured #url when persisting locations
"X-Foo": "BAR"
},
desiredAccuracy: 10, desiredAccuracy: 10,
stationaryRadius: 20, stationaryRadius: 20,
distanceFilter: 30, distanceFilter: 30,
...@@ -107,12 +110,24 @@ The plugin works with iOS and Android, however both platforms differ significant ...@@ -107,12 +110,24 @@ The plugin works with iOS and Android, however both platforms differ significant
### iOS ### 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
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. 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 ### Config
Use the following config-parameters with the #configure method: Use the following config-parameters with the #configure method:
......
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