我正在使用此代码在Apple设置应用中打开我的应用特定设置:
@IBAction func openSettings(sender: Any) {
UIApplication.shared.openURL(URL(string: UIApplicationOpenSettingsURLString)!)
}
这指向Settings>[my_app_name]
,但有可能指向Settings>[my_app_name]>Notifications
吗?
或者那是不可能的?
直到那时, 大卫。
答案 0 :(得分:7)
You can only open the root of your own app's preferences. You can't open a sub-section directly
答案 1 :(得分:0)
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>prefs</string>
</array>
</dict>
</array>
let url = NSURL(string: "prefs:root=yourBundleId")
UIApplication.sharedApplication().openURL(url!)