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

Use SettingsClient on Android to detect if location is enabled #171

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

jordond
Copy link
Owner

@jordond jordond commented Jan 24, 2025

While looking into #169 I discovered the new way to check if location services are available for Android devices.

This PR modifies LocationManager.locationEnabled() to use the SettingsClient API to check whether or not location services are enabled on the device. It still falls back to the legacy method of checking the LocationManager.isProviderEnabled

One downside to this approach is Geolocator.isAvailable() is once again a suspend fun. Which completely undoes the efforts of #105.

@jordond jordond added this to the 2.0.0 milestone Jan 24, 2025
@jordond jordond merged commit d114552 into main Jan 24, 2025
5 checks passed
@jordond jordond deleted the feature/update-location-available branch January 24, 2025 17:24
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

Successfully merging this pull request may close these issues.

1 participant