-2

please someone help me. How can I open Location Services from my app? I tried this but it doesn't work

URL(string: "prefs:root=LOCATION_SERVICES")
lucca910
  • 91
  • 1
  • 9
  • 4
    Try to look to answers to this post: [How to open Location services screen from setting screen?](https://stackoverflow.com/questions/37654132/how-to-open-location-services-screen-from-setting-screen) You're probably trying to implement second most rated answer but you forgot to set *URL Schemes*. But note using this may cause that your app will be rejected. – Robert Dresler Jan 08 '19 at 12:45
  • Read "may cause rejection" as "you're almost guaranteed to be rejected". – Gereon Jan 08 '19 at 12:58

1 Answers1

1

Opening a specific sub-screen of Settings programatically no longer works, since iOS 11. Now all you can do is open main screen of Settings App, using url string App-Prefs

mag_zbc
  • 6,801
  • 14
  • 40
  • 62
  • Using `App-Prefs` altogether is discouraged. With official settings url `UIApplication.openSettingsURLString`, you should open the settings screen. – Kamran Jan 08 '19 at 13:25