Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
christocracy committed Nov 26, 2014
1 parent 7bb7d9f commit 28e8123
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ On iOS the plugin will execute your configured ```callbackFn```. You may manuall

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.

The Android plugin sends an HTTP POST to your configured ```url``` with ```Content-Type: application/json```. The JSON location-data is encoded into the Request Body. PHP people have [trouble with this](https://github.com/christocracy/cordova-plugin-background-geolocation/issues/50). In PHP, find the raw JSON body with ```$data = file_get_contents('php://input');```.
The Android plugin sends an HTTP POST to your configured ```url``` with ```Content-Type: application/json```. The JSON location-data is encoded into the Request Body. PHP people have [trouble with this](https://github.com/christocracy/cordova-plugin-background-geolocation/issues/50). In PHP, find the raw JSON body with:

```$data = file_get_contents('php://input');```.

```
{
Expand Down

0 comments on commit 28e8123

Please sign in to comment.