Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

xcode - ios app store rejection - Your app uses the "prefs:root=" non-public URL scheme

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 scheme

I am almost sure that I don't use any Url scheme on my app I have tried finding prefs:root using grep -R in my entire project through terminal (case insensitive to be able to also match App-Prefs or whatever.

I also use a lot of cocoapods libraries so... my question is ... Is there a way to find out which library is using that permission?

Screenshot of search results on xcode

enter image description here

Frameworks used on my project:

  • AmazonFling
  • many others from CocoaPods (not listed because irrelevant: see my answer)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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)
    }
  }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...