19

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)
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Noel Carcases
  • 711
  • 1
  • 7
  • 27
  • 1
    I also faced that issue Would you like to check is there any "App-Prefs:root=" url is opened through app ? If yes Then this is the main cause because these are not a Public Url Schemes – Sagar Shirbhate Apr 26 '18 at 11:22
  • For Searching the entire project search through Xcode Search pannel – Sagar Shirbhate Apr 26 '18 at 11:24
  • I need to check where on my app I use that because I cannot find it and apprenttly apple does – Noel Carcases Apr 26 '18 at 11:25
  • UIApplication.sharedApplication().openURL(NSURL(string:"prefs:root=General&path=Keyboard")!) only this API is allowed other are not. – Sagar Shirbhate Apr 26 '18 at 11:26
  • Check through Whole code even though the cocoapods too. They Might use this – Sagar Shirbhate Apr 26 '18 at 11:27
  • Other way is give support to app from iOS9.3 Onwords by which they are allowed. – Sagar Shirbhate Apr 26 '18 at 11:27
  • I have just added a screenshot of xcode search results – Noel Carcases Apr 26 '18 at 11:29
  • I also confused How it is possible if not used then how this issue occures. I think just try to submit build again hope so it will be live sometimes this also helps. – Sagar Shirbhate Apr 26 '18 at 11:31
  • I will try to resubmit as I have no clue where the error may be. Please everyone feel free to comment your thougts – Noel Carcases Apr 26 '18 at 11:33
  • No need to resubmit it, just ask more detail on itunesconnect from Apple tester. – aBilal17 Apr 26 '18 at 11:40
  • I have already asked for more details and no answer from them.. anyone know how much time does they take to answer? – Noel Carcases Apr 26 '18 at 11:49
  • The question I did to apple was "wich command should I use to check if my app is ussing that api" (something like this is not exactly what I wrote) – Noel Carcases Apr 26 '18 at 12:48
  • I've searched all the pods: the culprit is likely one that is not open-source and that is obfuscating the string like JSQMessagesViewController did in the past when they wrote [`[NSString stringWithFormat:@"%@%@%@", @"_U", @"IRotat", @"ingAlertController"]`](https://github.com/jessesquires/JSQMessagesViewController/blob/f52e83bdb4d5c19ecfd5b6e54cdb9f2efa66cfcf/JSQMessagesViewController/Controllers/JSQMessagesViewController.m) to bypass detection of illegal use of `"_UIRotatingAlertController"`. If you're able to pinpoint the culprit in the future, don't forget to share the name! – Cœur Apr 27 '18 at 04:22
  • At the end the one with the issues was AmazonFling that was not listed on the pods because was installed ussing another method. AmazonFling does not have update yet so it was removed until they update it – Noel Carcases Apr 28 '18 at 05:35

7 Answers7

26

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)
    }
  }
Gurjinder Singh
  • 9,221
  • 1
  • 66
  • 58
4

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

3

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

Reference Image

2

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'

Chetu Test
  • 113
  • 1
  • 5
  • App Store will reject apps which use pres:root Guideline 2.5.1 - Performance - Software Requirements Your app uses the "prefs:root=" non-public URL scheme, which is a private entity. The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change. Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store. – Kumar C Nov 19 '18 at 14:50
1

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

Cœur
  • 37,241
  • 25
  • 195
  • 267
Noel Carcases
  • 711
  • 1
  • 7
  • 27
  • According to other users of the AmazonFling API, the Apple error message was actually "_"Your app uses or references the following non-public APIs: com.apple.springboard.lockcomplete "_". And this one is findable with `grep -R 'com.apple.springboard.lockcomplete'` – Cœur May 17 '18 at 09:56
  • Apple tell me about springboard later on.. but thanks for the comment! – Noel Carcases May 18 '18 at 13:29
0

We also faced the same issue and resolved it by this:

if let url = URL(string:UIApplication.openSettingsURLString)

    {
        UIApplication.shared.open(url, options: [:], completionHandler: nil)
    }
Nick
  • 4,820
  • 18
  • 31
  • 47
-1

To find out which library is using that permission, you can use this command in terminal

strings <file path> | grep 'prefs:root'

to search in dependencies compiled files, if you have no luck with search in Xcode.

CristinaTheDev
  • 1,952
  • 2
  • 17
  • 25