3

I have an iOS app, in which the user can enable/disable location tracking permission, so, on clicking a button in my app, I have to navigate the user to the location access page in system preference app,

I went through lots of answers, which suggested me to use

UIApplication.shared.open(URL(string: "App-prefs:LOCATION_SERVICES")!)

but they were all able to move to default settings, is it possible to move to a specific page like below image, i.e Settings -> Privacy -> Location Services -> My_APP ->

enter image description here

Thanks in advance..

chandru
  • 407
  • 1
  • 5
  • 26

1 Answers1

5

There is not a way to navigate the user to that specific settings you're asking about.
Also, please note it's not advised to use private APIs, including URLs like the one you mentioned in your question ("App-prefs:LOCATION_SERVICES").
To launch the Settings app, it's better to use existing UIApplication.openSettingsURLString:

UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!)
Jobert
  • 1,532
  • 1
  • 13
  • 37
  • Thanks Jobert for responding, well, it will navigate to settings home page, my query is I have to navigate to the location access page of my app, like the image I have added – chandru Feb 01 '21 at 10:48
  • 3
    @chandru I understand. However that is just not possible with existing APIs as I explained in my answer. – Jobert Feb 01 '21 at 10:51