Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)
like image 435
Noel Carcases Avatar asked Apr 26 '18 10:04

Noel Carcases


5 Answers

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 updated the code and It worked.

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)
    }
  }
like image 110
Gurjinder Singh Avatar answered Nov 17 '22 03:11

Gurjinder Singh


I had the same problem and I resolved it as following:-

Step 1:- Search for the Prefs:root in your app then you will find something as follows:-

 if let url = URL(string: "App-Prefs:root=Privacy&path=LOCATION") {
 // If general location settings are disabled then open general location settings
    UIApplication.shared.openURL(url)
 }

Step 2:- Change the above code section with the following one:-

 if let url = URL(string:UIApplicationOpenSettingsURLString) 
 {
    UIApplication.shared.open(url, options: [:], completionHandler: nil)
 }

Now rebuild your app and resubmit to the App Store with no worries :)

like image 28
Karanvir Singh Avatar answered Nov 17 '22 01:11

Karanvir Singh


I faced the same issue. "prefs:root=" url scheme is not accepted by iOS 11. Using the UIApplicationOpenSettingsURLString value fixed it.

Reference Image

like image 3
Nandun Thilina Bandara Avatar answered Nov 17 '22 03:11

Nandun Thilina Bandara


if you need to find with the 'prefs:root is:

Go to your project's target -> then Info -> then URL Types, there you should find URL Schemes with value like 'prefs' or 'prefs:root'

like image 2
Rupak Shakya Avatar answered Nov 17 '22 01:11

Rupak Shakya


At the end the one with the issues was AmazonFling that was not listed on the pods because was installed using another method. See the forums post about it: https://forums.developer.amazon.com/questions/167282/apple-app-rejected-because-of-non-public-apis-refe.html

AmazonFling does not have update yet (as of Apr 27, 2018) so I removed it until they update it.


Fixed in AmazonFling 1.3.2, released on the same day. See https://developer.amazon.com/fr/docs/fling/release-notes.html

like image 1
Noel Carcases Avatar answered Nov 17 '22 03:11

Noel Carcases