Reputation: 209
Is there a way to prompt or maybe enable the Location Service programmatically or at least navigate user to Privacy & Security > Location Services page if the Location Service is not enabled on IOS?
It seems that Waze and Google Maps are able to prompt a dialog like this and when user click on the "Settings", then it will navigate user to Privacy & Security > Location Services page.
On Flutter, I tried using Geolocator.openLocationSettings()
which navigate me to the app settings instead of Privacy & Security > Location Services and Location().requestService()
which only prompts a dialog that inform me to navigate to that page to enable the service.
Anyone has any idea on how to make it happen or is it impossible?
Upvotes: 3
Views: 552
Reputation: 1369
" I tried using Geolocator.openLocationSettings() which navigate me to the app settings instead of Privacy & Security > Location Services"
If location services is disabled from Privacy & Security -> Location Service toggle. you can check using CLLocationManager.locationServicesEnabled() in ios that location services are enabled or not. And if it is disabled you need to manually prompt an alert.
And that also will lead you to App settings, location service, not the General -> Privacy and Settings page. using below answer https://stackoverflow.com/a/73165811/833395
It is not possible to open General -> Privacy & Security app settings.
Upvotes: 0