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.
Author by
jose920405
Updated on September 16, 2022Comments
-
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:
But I can not make it work.
-
Mike over 9 yearsAs 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 over 9 yearsThis is incorrect, because in iOS 8 this is allowed.
-
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 over 9 yearshow would you go back to the app? Can you add a callback?
-
guyromb almost 8 yearsIt is now supported on iOS 9. Check this: stackoverflow.com/questions/37399893/…
-
superpuccio almost 5 yearsThis 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.)