Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open Location services screen from setting screen?

I want to open location service screen programmatically to turn on service.

enter image description here

like image 455
Monika Patel Avatar asked Jun 06 '16 09:06

Monika Patel


People also ask

How do I find Location Services in settings?

You can control what location information your phone can use. Open your phone's Settings app. Under "Personal," tap Location access. At the top of the screen, turn Access to my location on or off.

How do I enable Location Services in System Settings on iPhone?

You can turn Location Services on or off at Settings > Privacy > Location Services. You can turn Location Services on either during the Setup Assistant process or later through the Location Services setting. You can individually control which apps and system services have access to Location Services data.

How do I open Location Services on my iPhone?

Go to Settings > Privacy, then select Location Services. Select an app, then turn Precise Location on or off.


1 Answers

I have tried all the above answers,it's not working on iOS11..it just opens settings page and not the app settings .. Finally this works..

UIApplication.shared.open(URL(string:UIApplicationOpenSettingsURLString)!) 

Swift 4.2:

UIApplication.shared.open(URL(string:UIApplication.openSettingsURLString)!) 

Refer: https://developer.apple.com/documentation/uikit/uiapplicationopensettingsurlstring?language=swift

like image 108
Vijay Karthik Avatar answered Sep 19 '22 13:09

Vijay Karthik