How to open settings from my iPad application (Objective-C)

10,023

Apple no longer allows developers to open the Settings application from within their apps (iOS 5.1 and later).

EDIT

According to @Mike's comment below, this can be done in iOS 8+

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];

Using this prior to iOS 8 will result in a crash, however.

Share:
10,023
jose920405
Author by

jose920405

Updated on September 16, 2022

Comments

  • jose920405
    jose920405 over 1 year

    I've tried using:

    [[UIApplication sharedApplication] openURL: [NSURL URLWithString: @ "prefs: root = General & path = Network"]];
    

    And options trading all you see here:

    examples

    But I can not make it work.

    • Mike
      Mike over 9 years
      As far as iOS 6 and 7, this can not be done. With iOS 8, it can be done using the following code: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
  • Mike
    Mike over 9 years
    This is incorrect, because in iOS 8 this is allowed.
  • Mike
    Mike over 9 years
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; is how it is done, although just in case anyone sees this, this will crash if you try to run it in iOS 7 as the const doesn't exist.
  • kevinl
    kevinl over 9 years
    how would you go back to the app? Can you add a callback?
  • guyromb
    guyromb almost 8 years
    It is now supported on iOS 9. Check this: stackoverflow.com/questions/37399893/…
  • superpuccio
    superpuccio almost 5 years
    This won't open the Settings homepage. Instead, it will open the app settings page (it's the page where users can see/opt-out permissions like GPS, Camera access, notifications etc.)