13

My app uses a URL scheme to take users directly to Settings/General/About section, the following URL was working fine in 10.3.x.
"App-Prefs:root=General&path=About"

However, this URL scheme no longer works in iOS 11 GM build. It only launches the Settings app, but doesn't take user any further. Does anybody know if this is expected in iOS 11 official release? Thanks in advance.

Ben Z.
  • 157
  • 1
  • 1
  • 9
  • https://medium.com/the-traveled-ios-developers-guide/ios-11-privacy-and-single-sign-on-6291687a2ccc – Govaadiyo Sep 16 '17 at 12:29
  • 2
    Ok, I just upgraded my iPhone to iOS 11. The Settings URL scheme will only launch the Settings app. It won't drill down to any particular section any more. This is super frustrating... Thanks Apple! – Ben Z. Sep 19 '17 at 18:35
  • Did you get any solution for this?? – Niki Oct 04 '17 at 13:24
  • 1
    No known solution yet. For folks who posted "working" solutions, I think they had the Settings app already open to a particular section. So when the URL scheme launches Settings, it's brought to the foreground showing section which was already open. E.g. go to Privacy section in Settings => push Settings to background => launch own app with custom URL scheme => Settings it brought into foreground showing "Privacy". To test whether a solution works, you have to close the Settings app prior to launching it with URL scheme. – Ben Z. Apr 25 '18 at 12:23
  • These are private APIs that could get your app rejected. Don't use them. I haven't found a legal way to provide the same functionality though. – tzm41 Jul 12 '18 at 15:27

6 Answers6

2
let url = NSURL(string: "app-settings:root=Privacy&path=LOCATION")! as URL
UIApplication.shared.open(url, options: [:], completionHandler: nil)

It works fine for me, iOS11 both on iPhone device and simulator.

"App-Prefs:" change to "app-settings:" then will work.

lam kai man
  • 103
  • 4
1

This no longer works since iOS 11.

Here are the only things you can do currently:

Open the Settings app (whatever's written after the : is ignored)

UIApplication.shared.open(URL(string: "App-prefs:")!)

Open your App settings

UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!)
Ribesg
  • 358
  • 4
  • 15
0

I don't have a working solution, but found something interesting. The following two URL schemes will both launch the Settings app.

"App-Prefs:" "app-settings:"

So it looks like iOS is ignoring root=xyz&path=123 altogether...

BamBam
  • 17
  • 2
-2
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];  

this may be better than "app-settings" However, I need to open the system location enable setting, looked like this cannot be resolved anymore at iOS 11

Petter Friberg
  • 21,252
  • 9
  • 60
  • 109
Henry Zhang
  • 254
  • 1
  • 2
  • 6
-2

After receiving some new suggestions, I believe the best we can do in iOS11 is to take user directly to the app's own section in Settings with the code below:

In Objective-C:

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

I tried this on my iPhone SE and was able to launch into app's own settings section.

Mehrdad Pedramfar
  • 10,941
  • 4
  • 38
  • 59
Ben Z.
  • 157
  • 1
  • 1
  • 9
-4

I use "app-settings:root=Privacy&path=LOCATION" work fine in iOS8、iOS9、iOS10 and iOS1. It's really good solution.

范陆离
  • 91
  • 1
  • 3
  • Thanks for sharing your solution. I tried it in iOS 11 simulator but it only launches the Settings app, not seeing the location sub menu. Based on all my research thus far, it doesn't seem like this is possible in iOS 11 unless Apple opened a backdoor for you (E.g. Google Maps is able to take user directly into a sub section of the Settings app). – Ben Z. Sep 28 '17 at 13:19