简体   繁体   中英

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.

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.

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

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

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

这可能比“app-settings”更好但是,我需要打开系统位置启用设置,看起来这样无法在iOS 11中解决

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM