-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Not getting location updates when gps is turned off #399
Comments
There 2 possible approach I may recommend:
|
I already implemented both of these approaches. In the second approach, instead of starting a new location request, i'm just raising a audio notification to the user to switch on the GPS. If i make a new location request using another location service provider, will it automatically turn on the GPS or will it prompt a message to the user to TURN ON GPS ?? |
Other location providers shouldn't prompt user to turn on the GPS and it won't turn the GPS on automatically, runtime permission is required.
|
Yes, it is a tracker. So I'm notifying the user to turn on the GPS. Can you give more details about the last option, calling 3rd party location APIs. What 3rd party location APIs are available and what have you used ? |
There are lots of options but I have had a quick search for you to kick start your research 😉. Advice:
|
In a foreground service, i'm using FusedLocationProviderClient to request for location updates. I'm using foreground service because, i want location updates even when the app is closed. so far so good. it is working. But the problem is, if the gps is turned off then i'm not getting the onLocationResult() call back. How to handle this problem ?? Before starting the service, location was on and i got a couple of callbacks in onLocationResult() method. After sometime, user turned off the gps, after that i'm not getting the onLocationResult() call back. Any idea how to deal with this problem ??
The text was updated successfully, but these errors were encountered: