Closed dancalifornia closed 6 years ago
Would you mind providing a little more info about the issue:
@coolbrow
I'm using the listeners as a indicator that the tracking has stopped. I was receiving events and locations events during the initial foreground and background. When I resumed the app however, I do not get any more events and locations event calls.
I am currently testing with IOS, I can see if I get the same behavior on Android.
When I resumed the app however, I do not get any more events and locations event calls.
Are you expecting events and locations immediately upon application resume? The SDK will shutdown to preserve battery when the user is stopped and wont deliver events until that user has moved ~100+ meters. Similarly, even if the user is moving we'd only expect events/locations every few minutes, so a few minutes without any updates may not be indicative that tracking has stopped. Do you mind walking me through your testing steps to reproduce this issue?
It's worth noting that you can call trackOnce()
to initiate an on-demand location update if this is the desired behavior.
I load the app and walk until I receive an event. I put the app in the background and walk another 5 minutes. I reopen the app and walk back to initial spot (~10 min walk in opposite direction) waiting for an event, (but never get one).
Thanks for the detailed info, are you seeing any updates in your dashboard? And just to confirm, you are definitely seeing events while the app is in the background? From the reproduction steps it sounds like you're only receiving an initial event and no updates after that.
I am indeed getting events in the background the first time I put it into the background. I tried to reproduce through the simulator, unsuccessfully. Changing the location in the simulator in foreground and background almost always triggers a location event and an event event, provided the coordinates I supplied is close to something.
I'm going to take the device I am testing with a bit further tonight on my way home and see if i get any more event / location updates from it. I wonder if I'm just not going far enough during my testing, though I walk pretty far since the last logged event, which makes me skeptical that this is the case.
@coolbrow Quick update: So I took the testing device home and it did actually log my location. Even after putting it in background / resuming. I guess I was really not walking far enough for it to fire off location updates when I was testing yesterday. Thanks for the tidbit about the user having to move more than ~100+ meters. Going to close the issue.
Location tracking appears to be working when the app is initially started in the foreground and continues to track when put in the background, however, when the app is resumed in the foreground, tracking stops all together both in the foreground and background. I have listeners set up for events, locations and errors, and do not see any errors coming through. Any thoughts?