简体   繁体   English

是否可以以编程方式打开设置应用程序? (不是设置应用中的应用设置)

[英]Is it possible to programatically open the settings app? (not the app settings within the settings app)

I want my app to be able to launch the user into the iTunes & App Store section of the Settings app. 我希望我的应用能够将用户启动到“设置”应用的“ iTunes和应用商店”部分。 This doesn't seem to be possible so instead I would like to just take the user to the top level of the Settings app so they can access the iTunes & App Store section from there. 这似乎是不可能的,所以我只想将用户带到“设置”应用程序的顶层,以便他们可以从那里访问“ iTunes&App Store”部分。

Is this possible? 这可能吗? All previous answers relating to this are regarding launching into the app's settings within the Settings app. 与此相关的所有先前答案都与在“设置”应用程序中启动该应用程序的设置有关。

Yes it is possible, use UIApplication.shared.open(URL(string:"App-Prefs:root=STORE")!, options: [:], completionHandler: nil) to open AppStore Settings. 是的,可以,使用UIApplication.shared.open(URL(string:"App-Prefs:root=STORE")!, options: [:], completionHandler: nil)打开AppStore设置。 It may not work on Simulator but it works on real device. 它可能无法在Simulator上运行,但可以在真实设备上运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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