iOS: You’re Doing Settings Wrong

One of the apparently less known features for iOS 8 and above is the ability to deep link the user into Settings, where they can enable their Location, Notifications, Contacts, Camera, Calendar, HealthKit, etc for your app as needed.

Most apps just have an alert that pops up giving instructions such as “Go to Settings > Privacy > Location > OUR_APP”. The Twitter app, for example, has a more elaborate, nicely styled directions dialog, so I’ll use it as an example here (but again, too many apps have a much worse version of this unfortunately):



So I’m writing this post as a frustrated user hoping that more iOS developers will just deep link directly to settings, especially since it’s so easy!

Ok, so here’s the code for an alert in a Calendar-related app I’m working on that will include an option to take the user into settings:

And just to point it out once again, this is the only code you need to add to deep link the user into the Settings for your app!

So when the user has denied the needed permission, you can now be a lot more like the Swarm app:

Swarm App Settings

When the user clicks “Open Settings”, they’re conveniently take to this screen:

Swarm Open Settings

Just adding these 3 lines of codes will improve the user experience for a very important aspect of your app – the need for permissions to be enabled!!! In my case, the user can’t even continue using the app without the Calendar being authorized. So making it the easiest possible for them to change the permissions in Settings is in my best interest. Same thing applies to many other apps out there.

Note: As @jl_hfl points out, this gets even better in iOS 9! The Settings screen will have a back button to take the user directly back into your app! Seriously, there is absolutely no excuse to NOT use this.

Enjoy the article? Join over 14,500+ Swift developers and enthusiasts who get my weekly updates.

  • Mush Room

    1 thing i’ve faced recently: if you didn’t ask for any system permissions before — user will be just taken to settings, not the app settings screen.

    • What is the use case for this? Why wouldn’t ask for permissions first?

      • Mush Room

        Just a developer mistake where we did not saved info about if we asked for permissions before ¯_(ツ)_/¯

        • Jorge Galrito

          You don’t have to save that, you just need to ask the relevant framework the status of the authorization.

  • Thanks Natasha! It’d be handy if we could deep link into other areas of Settings (General, Wi-Fi, etc) too. It was possible in earlier versions of iOS.

    • Still better than trying to explain to the user how to get to Settings themselves… but yes, would be nice to have more granular deep link control.

    • Totally agree. Would be much more user friendly if we could link to specific settings.

    • JohnWong

      In ios = 5.1 apple discontinued it. In iOS 8, there is a new way to open shortcur urls again. You can open these urls in today extension, like Launcher app(

    • Ian Miller

      As of iOS9 this became possible again. Put “prefs:root=WIFI” into Safari to see it in action. I just discovered this and I’m pretty stoked to use it. Full discussion on stackoverflow here: (you have to read deep into the newer comments).

      • David James

        It appears that as of iOS 10, it’s no longer allowed to use the “prefs” URL parameters to open other areas of Settings. These are considered private API, and use of them are causing apps to be rejected. See

        (This doesn’t affect the main purpose of this article, which uses the publicly available UIApplicationOpenSettingsURLString)

  • Cypherpunks (a public account)

    > “deep link the user into Settings, where they can enable their Location, Notifications, Contacts, Camera, Calendar, **HealthKit**, etc for your app as needed.”

    Wish that were true, but unfortunately the settings for Apple Health (aka HealthKit) do not currently appear in an app’s settings as the others do.


  • Fábio Nogueira


  • Mourad Khalfallaoui

    brilliant !

  • This is really cool, especially with the iOS 9 update mentioned

  • kraigspear

    Thanks, I was doing it all wrong.

  • fabb

    Only issue I came accross: If the user has disabled location services systemwide, we cannot link to this setting. The location access setting in the app’s setting will just be greyed out. We decided its’s less confusing in this case to not provide a button that links to the app settings.

  • JohnWong

    I have faced this problem. The method described in this post can not work if user has disabled location services, as fabb described. So I decide to provide this button if location service is disabled, location permission is denied and system version >= 8.0, or I will show the guide.

  • The code provided actually seems to link to the application settings, as opposed going through Settings > Notifications > Set Allow…

    Was this the intended behavior?

  • titleist1002

    Where did you get these icon images for your alert view?? I want to add them to mine but can’t find a good source of them

  • TinyGreenMonster

    I believe the twitter example is correct for their user experience because as of iOS9, as far as I have been able to discover, we can only link to our Application settings with in General Settings. This creates confusion if you need the user to go to privacy like for Apple Health.

    • Ian Miller

      You can deep link into Settings->Privacy but not deeper than that (i.e. into contacts, health). Try going to “prefs:root=Privacy” in safari as an example.

  • John Grauel

    Hello Natasha. Excellent article. I have implemented this procedure in an app that uses the camera. When my app is started from a device, it works perfectly (including the IOS 9 link back to the app). However when I launch from Xcode, the instant I touch the settings switch, Xcode crashes. No data, just the dreaded thread 1 signal sigkill message. Both scenarios are 100% always works from device, always fails from Xcode. Any advice?

    • Nathan Cope

      When you change ANY privacy settings for the app, Apple force closes your application. That’s what you’re seeing in xcode as a crash. It’s not a crash though, it’s just closing. If you run this on your phone without xcode, it will be seamless and you won’t even know that the app is closing. HOWEVER, note that anything you were doing in the app before you started changing privacy settings will be lost. I’m having difficulty with this, as now I’ll have to find a way to bring the user all the way back to where they were in the app. :/ This should be mentioned in the article above. The app closes in the background if you’re changing settings while the app is active!

  • Roger Pingleton

    Note: In the “Important” section of Apple’s QA 1924 ( it states that the prefs: URL scheme is considered undocumented and is cause for App Store rejection when used in any other way than what is outlined in that document.