Reputation: 755
I want to open iphone default setting
application form my application
, Please any one tell me what I have to do. OR is there any code to open it.
I try following code but it dont works.in iOS 7.1.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES_Systemservices"]];
Thanks in Advance.
Upvotes: 1
Views: 8241
Reputation: 216
Swift 4
let url = URL(string: UIApplicationOpenSettingsURLString)
if UIApplication.shared.canOpenURL(url!) {
UIApplication.shared.openURL(url!)
}
Upvotes: 0
Reputation: 8568
For iOS8 and later use :
// Send the user to the Settings for this app
//iOS 8 only
NSURL *settingsURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
[[UIApplication sharedApplication] openURL:settingsURL];
Upvotes: 2
Reputation: 257
You can use private API to open Settings App from your application. But i'm not sure if it will get accepted from apple.
void (*openApp)(CFStringRef, Boolean);
void *hndl = dlopen("/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices", 0);
openApp = dlsym(hndl, "SBSLaunchApplicationWithIdentifier");
openApp(CFSTR("com.apple.Preferences"), FALSE);
Upvotes: 0