从iOS 11中的应用程序打开“设置”应用中的特定项目 [英] Open specific item in Settings app from my app in iOS 11
问题描述
我已经研究了几个答案,但没有发现任何适用于iOS 11的答案。
I have studied several answers and haven't found any that would work for iOS 11.
我想展示切换背景应用程序刷新的方法用户。要做到这一点
我想从我的应用程序打开设置/常规/后台应用刷新
菜单。
以下代码仅打开设置应用的根菜单。
I want to show the way to switch Background App Refresh on for my user. To do that
I want to open Settings/General/Background App Refresh
menu from my app.
The following code only opens root menu of the Settings app.
guard let url = URL(string: "App-Prefs:root=General&path=BACKGROUND_APP_REFRESH") else { return }
UIApplication.shared.open(url, options: [:], completionHandler: nil)
Apple有什么方法可以做到这一点?
Is there any way that would be allowed by Apple to do that?
推荐答案
如果您打开URL UIApplicationOpenSettingsURLString
然后您将获得应用的设置,其中包括后台应用刷新功能。
If you open the URL UIApplicationOpenSettingsURLString
then you'll be taken your app's settings, which includes background app refresh.
这篇关于从iOS 11中的应用程序打开“设置”应用中的特定项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!