我正在寻找一种解决方法,以在 iOS 10 中使用 openURL 打开设置应用程序,其字符串如下:prefs:root=SOMETHING
终于找到了this使用“灰色 API”的解决方案,我认为它只是使用 LSApplicationWorkspace 的运行时 header 的私有(private) API .
我试图让它在这个 post 上也能正常工作但我无法在没有任何错误的情况下编译它。
有谁知道如何使用这个LSApplicationWorkspace
代码:
//url = "prefs:root=SOMETHING"
[[LSApplicationWorkspace defaultWorkspace] openSensitiveURL:url withOptions:nil];
我总是在编译头文件时遇到多个错误:
unknown type name
后跟例如:"LSInstallProgressDelegate"
但也许有更好的方法来使用此代码和一般的“灰色 API”。我可以使用私有(private) API,因为这是一个内部应用程序。
最佳答案
请引用我试过的这个链接,它有效。 https://gist.github.com/johnny77221/bcaa5384a242b64bfd0b8a715f48e69f
关于ios - 将 iOS 10 中的 "prefs"URL 方案与 LSApplicationWorkspace 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41424703/