Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to open Settings App using openURL?

Tags:

I know an app can launch other apps by using this code: [[UIApplication sharedApplication] openURL:appUrl];. And I know the scheme of URL to open safari and mail, but I did some searches and found nothing about the scheme of settings.app.

like image 881
chenze Avatar asked Jul 07 '09 04:07

chenze


2 Answers

You can open settings apps programmatically try this(works only from iOS8 onwards).

If you are using Swift:

    UIApplication.sharedApplication().openURL(NSURL(string: UIApplicationOpenSettingsURLString)) 

If you are using Objective-C

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

For other lower versions(less than iOS8) its not possible to programatically open settings app.

like image 176
Yatheesha Avatar answered Oct 11 '22 14:10

Yatheesha


You can use this in iOS versions 5.0 - 5.0.1. It was then deprecated in iOS 5.1.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs://"]]; 
like image 44
davidcann Avatar answered Oct 11 '22 13:10

davidcann