Android: server side #50

YairHadari opened this Issue Jul 22, 2014 · 5 comments


None yet

3 participants



From JS I'm calling PHP file that are creating a text file with $_POST['location'] - only for tests.
The problem is that nothing is being passed to $_POST['location'] .
The JS is:
bgGeo.configure(callbackFn, failureFn, {
url: '', // <-- only required for Android; ios allows javascript callbacks for your http
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,
debug: true, // <-- enable this hear sounds for background-geolocation life-cycle.
notificationTitle: 'Background tracking', // <-- android only, customize the title of the notification
notificationText: 'ENABLED' // <-- android only, customize the text of the notification

The PHP code is:

Can someone assist please?


it was answered in another issue I believe; instead or reading data from $_POST you need to obtain the data sent to your PHP script by:

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

simple logging:

file_put_contents("/tmp/tracklog", file_get_contents('php://input'),"\n", FILE_APPEND);


Thanks, problem was solved!!!

@YairHadari YairHadari closed this Aug 3, 2014

Thanks @georgetudor

On Sunday, August 3, 2014, YairHadari wrote:

Closed #50

Reply to this email directly or view it on GitHub
#50 (comment)

Snet from Gmail Mobile


Thank you Chris for a great plugin :)


FYI Android has been completely refactored in Premium Version

  • No more in-plugin HTTP -- plugin now executes your Javascript callback, just like iOS
  • Significantly improved battery performance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment