Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

URL Scheme "Open Settings" ios

I know this question has been asked so many times. The answers say that this is not available in Xcode > 5.x. but I saw some apps that can use this(Go to Settings)(iOS7). Is there any way to do this? Is it available in Xcode 6? Facebook can detect both cellular data and wifi.

enter image description hereenter image description here

like image 754
MaappeaL Avatar asked Sep 23 '14 06:09

MaappeaL


People also ask

How do I get iOS URL scheme?

First, you have to download the IPA file for the app, which requires macOS and Apple Configurator 2. When you finally find the IPA, you have to turn it into a ZIP file, show the contents of the app package, then hunt for the specific PLIST file that contains the scheme names.

What is URL scheme in iOS?

URL schema is used as an identifier in launching applications and performing a set of commands in iOS devices. The schema name of a URL is the first part of a URL. (e.g. schemaname:// ). For web pages, the schemas are usually http or https.


2 Answers

As of iOS 8, it's possible to launch the Settings app that directly opens your Privacy app section in this way:

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

In Swift:

if let settingsURL = NSURL(string: UIApplicationOpenSettingsURLString) {
    UIApplication.sharedApplication().openURL(settingsURL)
}

In Swift 3.0:

if let settingsURL = URL(string: UIApplicationOpenSettingsURLString + Bundle.main.bundleIdentifier!) {
    UIApplication.shared.openURL(settingsURL as URL)
}
like image 95
BalestraPatrick Avatar answered Oct 08 '22 13:10

BalestraPatrick


1.- Add URL Types enter image description here

2.- Use:

Objective - C

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

Swift

 UIApplication.sharedApplication().openURL(NSURL(string: "prefs:root=General")!)

3.- Other path find in this answer: iOS Launching Settings -> Restrictions URL Scheme

like image 7
Pablo Avatar answered Oct 08 '22 14:10

Pablo