I know there are many questions related to this.
1) is it possible to open Settings App using openURL?
2) Opening the Settings app from another app
3) iOS Launching Settings -> Restrictions URL Scheme
I have followed these questions for reference but that does not solve my query. I know that using openURL
method you can open Settings but that was valid for only iOS 5.0 - 5.0.1. In iOS 5.1 it was deprecated.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs://"]];
Still I have been seeing lot of Apps mainly location based which asks for user permission to turn on Location Services and takes directly to Location Services under Settings--> Privacy. The screenshot of an App, which is installed on iOS 6.1 running device, below shows that tapping on Settings take you to directly Location Services.
I tried to run code in my App but it is not working (I want to take user to Settings page to allow my app to access contact information directly from my App). If Apple has disabled URL Schemes for this how come many Apps are still using it?
Access the iOS Settings from the App Library To access the App Library, swipe left on your Home Screen until you reach it. Locate the gray gear Settings icon in the iPhone App Library and tap on it.
For apps that tie into services such as Location, the first time they request access the OS will throw out the alert with buttons that link to Settings. This isn't actioned by the app, but by the underlying security of the OS.
iOS 6 removed the ability to do this yourself as you mentioned.
You can open settings app programmatically in iOS8, but not in earlier versions of iOS.
In Swift:
UIApplication.sharedApplication().openURL(NSURL(string:UIApplicationOpenSettingsURLString));
Swift 4:
if let url = NSURL(string: UIApplicationOpenSettingsURLString) as URL? {
UIApplication.shared.openURL(url)
}
In Objective-C
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With