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?
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