Settings URLs

WARNING:

The process described below was noted as disabled back in 5.1 beta 1 and not only do they continue to not work in 5.1 final, people are noting review rejections for using them. So the following should be taken as a nugget of historical interest only. Or cause to file a Radar to plead for them back!

***********

So you ever wanted to be able to send the user to a particular Settings page? Yeah, us too … pretty frequently actually.

Well, now you can in iOS 5 with the prefs: URL scheme with [UIApplication sharedApplication] openURL:

Turn on Location Services?

[NSURL URLWithString:@”prefs:root=LOCATION_SERVICES“]];

Set up Twitter?

[NSURL URLWithString:@”prefs:root=TWITTER“]];

Hook up a Bluetooth device?

[NSURL URLWithString:@”prefs:root=General&path=Bluetooth“]];

Handy, indeed. And why yes, yes they do work just fine in Mobile Safari as well; load this page up on your device and tap any of the sample links above to see for yourself!

Alex | November 4, 2011
  • Florian Agsteiner November 5, 2011 at 12:56 am
    Thanks for the hint you can even show your own settings: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=Apps&path=Your+App+Display+Name"]];
    • hiroshi November 9, 2011 at 5:47 pm
      Is it true? I failed to do it. e.g. prefs:root=Apps&path=iBooks FYI: I used Safari's url bar to enter the URL
    • gudin November 17, 2011 at 12:53 pm
      This does not appear to work for me either. I do this: - (void) openSettingsApp { NSString *appDisplayName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"prefs:root=Apps&path=%@", appDisplayName]]]; } It opens settings, but does not open MY settings. Only the general settings app. Also, is this iOS 5 +? Thanks for the hint, regardless.
  • Esa Ruoho November 8, 2011 at 2:09 am
    Thanks! Just got [NSURL URLWithString:@"prefs:root=General&path=Network"]]; working from a website, so now can get to toggling 3G On and Off very quickly. Next step would be to create some sort of a web-clip icon on my iPhone and click that to get directly to General->Network. Not sure how I'd accomplish that, but really nice to know that iOS5 allows for directly going to where one needs to go..
  • Yoo-Jin Lee November 9, 2011 at 4:36 pm
    @FIORIAN You can create your own Home screen icon with custom urls, like the ones in this article, with aHomeIcon (shameless plug) . There are some other Apps but I think aHomeIcon has the most comprehensive set of features. You can download aHomeIcon here : http://itunes.apple.com/us/app/ahomeicon/id417171558?mt=8&uo=4
  • Mare November 11, 2011 at 9:13 am
    Set just saved image as a wallpaper [NSURL URLWithString:@"prefs:root=Wallpaper"]];
  • manzarock November 15, 2011 at 3:00 am
    Hi, it's a useful trick. Do you know if there're some problem using it with the Apple review process?
  • Mariano November 15, 2011 at 1:14 pm
    I can't seem to make this url work... any ideas? prefs:root=Notifications
  • Anystone Tech, Inc. November 21, 2011 at 3:34 pm
    For what it's worth, an app of mine was just rejected for using these. Use at your own risk.
    • Speck Tastisch March 14, 2012 at 3:11 am
      Can anyone confirm this? And @anystonetech what was Apples comment?
      • anystonetech March 14, 2012 at 5:23 am
        It was essentially that we were using undocumented API's. I think you'll find that Apple disabled them altogether in 5.1 (actually, maybe even in 5.0.1 - I don't recall which). Hopefully they will bring them back in a documented form in some future version of iOS.
  • Charles Fulnecky March 25, 2012 at 4:50 am
    iOS 5.1 removed the Settings App – custom URLs. This meant that users were unable to use shortcut creator Apps to easily create shortcuts to view their most used Settings screen. http://www.mokten.com/2012/03/settings-app-custom-url-petition/
  • Subborter July 12, 2012 at 7:37 pm
    I just wondering where do you get those URLs? Can you post the source url?

Leave a Reply