Ben Z.
Ben Z.

Reputation: 157

iOS 11 URL Scheme for specific Settings section stopped working

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.

Upvotes: 13

Views: 12787

Answers (6)

Ribesg
Ribesg

Reputation: 778

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)!)

Upvotes: 1

Ben Z.
Ben Z.

Reputation: 157

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.

Upvotes: -2

Henry Zhang
Henry Zhang

Reputation: 274

[[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

Upvotes: -2

lam kai man
lam kai man

Reputation: 103

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.

Upvotes: 2

范陆离
范陆离

Reputation: 91

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

Upvotes: -4

BamBam
BamBam

Reputation: 17

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...

Upvotes: 0

Related Questions