[英]How do I take the user in my iOS app to the Messages Settings?
How would I take the user from my app to the Messages Settings? 我如何将用户从我的应用程序转到“消息设置”? I know the code to use, but I don't know the specific string literal to create the correct URL with to the UIApplication.shared.open(URL:options:) method with.
我知道要使用的代码,但我不知道用于使用UIApplication.shared.open(URL:options :)方法创建正确URL的特定字符串文字。 I think the literal needs to start with "prefs:root=".
我认为字面量需要以“ prefs:root =“开头。 It needs to be something like the following.
它需要类似于以下内容。 I just need to know what literal to use instead of "Messages".
我只需要知道使用什么文字而不是“消息”即可。
let urlString = "prefs:root=Messages"
let url = URL(string: urlString)!
let options: [String: Any] = [:]
UIApplication.shared.open(url, options: options) {
bool in
print(bool)
}
I figured it out. 我想到了。 I have to use the string literal "App-Prefs:root=MESSAGES".
我必须使用字符串文字“ App-Prefs:root = MESSAGES”。
let url = URL(string: "prefs:root=MESSAGES")!
UIApplication.shared.openURL(url)
Will open Settings->Messages 将打开设置->消息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.