I recently uploaded a new version of my app to itunes connect. My app got rejected with this note
Your app uses the \"prefs:root=\" non-public URL s
I faced the same rejection form Apple and to open app settings i was using the below code and it's not accepted on iOS11.
let url = URL(string : "prefs:root=")
if UIApplication.shared.canOpenURL(url!) {
UIApplication.shared.openURL(url!)
}
So, to open Settings, I used the below code and App was approved.
guard let settingsUrl = URL(string: UIApplicationOpenSettingsURLString) else {
return
}
if UIApplication.shared.canOpenURL(settingsUrl) {
if #available(iOS 10.0, *) {
UIApplication.shared.open(settingsUrl, completionHandler: { (success) in
})
}
else {
UIApplication.shared.openURL(settingsUrl)
}
}