Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: Multiple location requests at once #42

Closed
stefaniebrunner opened this issue Jun 23, 2014 · 7 comments
Closed

question: Multiple location requests at once #42

stefaniebrunner opened this issue Jun 23, 2014 · 7 comments

Comments

@stefaniebrunner
Copy link

Why do I receive on my server about 20 locations all at once? I was testing the plugin with one device and received always circa 20 requests from that only device.
Is that a configuration issue?

@christocracy
Copy link
Owner

Android caches locations on the device when no network connection is
detected.

Once a network conn is detected, it spews them out all at once. Check the
time stamps--they'll all be staggered by ~30s.

I test Android without a SIM card, heading out for a 30min walk, for
example; once I get onto my wifi network, the cache is emptied all at once.

On Monday, June 23, 2014, stefaniebrunner notifications@github.com wrote:

Why do I receive on my server about 20 locations all at once? I was
testing the plugin with one device and received always circa 20 requests
from that only device.
Is that a configuration issue?


Reply to this email directly or view it on GitHub
#42
.

Snet from Gmail Mobile

@stefaniebrunner
Copy link
Author

Yes, but I receive these amount of locations right after I start the background-service.
My device has a SIM card and it has wifi connection. I did not walk around, just sit on the coach.
When I start the service, about ~30s later I receive the locations.

@christocracy
Copy link
Owner

Is your server returning http 200? if not, the plugin will keep on trying
to send those locations to the server.

Try deleting the app from device, re-install.

On Mon, Jun 23, 2014 at 11:07 AM, stefaniebrunner notifications@github.com
wrote:

Yes, but I receive these amount of locations right after I start the
background-service.
My device has a SIM card and it has wifi connection. I did not walk
around, just sit on the coach.
When I start the service, about ~30s later I receive the locations.


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

Chris Scott
Transistor Software http://www.transistorsoft.com

@stefaniebrunner
Copy link
Author

You're right. There were some older locations in the cache in case of failure response.
Thanks for the hint.

@stefaniebrunner
Copy link
Author

...is there a possibility to check de response state from server in the app on android? I have always locations in my cache and don't know why.
On the server I receive and print the location, there is no error. But on the second start of service I'm getting the first and second location, and at the next start of service I'm getting the first, second and third location.
I can't figure out why does the locations stay in cache. Do you have anymore ideas?

@christocracy
Copy link
Owner

No way to check — the Android bg-geolocation plugin runs as an autonomous
server, disconnected from your main application.

Your server MUST return http status 200 for the location to be removed from
cache, otherwise the plugin tries and tries and tries.

Tail your server logs while running the app, there’s probably a 500 being
caused or something.

On Thu, Jun 26, 2014 at 11:47 AM, stefaniebrunner notifications@github.com
wrote:

...is there a possibility to check de response state from server in the
app on android? I have always locations in my cache and don't know why.
On the server I receive and print the location, there is no error. But on
the second start of service I'm getting the first and second location, and
at the next start of service I'm getting the first, second and third
location.
I can't figure out why does the locations stay in cache. Do you have
anymore ideas?


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

Chris Scott
Transistor Software http://www.transistorsoft.com

@christocracy
Copy link
Owner

FYI Android has been completely refactored

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

http://transistorsoft.github.io/cordova-background-geolocation/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants