-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Location: Implement settings request #2216
Location: Implement settings request #2216
Conversation
For some applications that require GPS function, detect and remind the GPS to check in, such as Google Maps
The implemented behavior does not match the documented behavior. According to https://developers.google.com/android/reference/com/google/android/gms/location/SettingsClient, determining the status does never directly result in a dialog to request changes. Instead, when the result does not match the request (the |
In my opinion it is better to simply show a dismissable notification that the user can choose to click or to just ignore. |
With the intended flow (using a resolution pending intent) it's up to the calling app if they want to show the dialog to the user or not. I think that's a pretty good solution, as only the calling app knows if it's sensible to disturb the user a lot or not. |
Google Maps will not pop up a box to request when the GPS is not turned on, so this function was implemented. |
That's because the current implementation on master does not return a resolution pending intent if the location request is not met yet. Returning a resolution pending intent should result in the desired behavior in Google Maps without breaking other apps as your implementation would. Check again the documentation on https://developers.google.com/android/reference/com/google/android/gms/location/SettingsClient |
I re-improved the requestLocationSettingsDialog function |
For some applications that require GPS function, detect and remind the GPS to check in, such as Google Maps