Open specific item in Settings app from my app in iOS 11

☆樱花仙子☆ 提交于 2019-12-02 21:06: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)

Is there any way that would be allowed by Apple to do that?


回答1:


If you open the URL UIApplicationOpenSettingsURLString then you'll be taken your app's settings, which includes background app refresh.



来源:https://stackoverflow.com/questions/48771321/open-specific-item-in-settings-app-from-my-app-in-ios-11

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!