FusedLocation API - onLocationChanged is not called

Viewed 658

The flow in our app is the following:

  1. show a fullscreen activity explaining to the user why we need the GPS-location
  2. acquire the permission for GPS
  3. display loading spinner
  4. get first geolocation
  5. send first location to server
  6. load relevant data from server
  7. hide loading spinner

we've had multiple support requests from users saying that nothing happens and that they only see the loading spinner.

We're enforcing activated GPS-Providers at the moment, so it's not an issue of inactive locationservices.

I've managed to reproduce the bug by creating a user account on one of our phones and starting the app and I've noticed that onLocationChanged is not called

The code gets past LocationServices.FusedLocationApi.requestLocationUpdates, so it should provide locations, but it doesn't

I know that I solved this issue in the past by opening google maps, but

a) I can hardly imagine that users did not use google maps so far b) telling them to open google maps to fix an issue in our app sounds weird

here is a gist of the exact code used (I set a breakpoint on line 131, started to debug and got there, so I should be getting locations, but the method onLocationChanged is never called

1 Answers
Related