ios app store rejection - 您的应用使用“prefs:root =”非公共URL方案

问题描述 投票:15回答:6

我最近向itunes connect上传了我的应用程序的新版本。我的应用程序被此笔记拒绝了

您的应用使用“prefs:root =”非公共URL方案

我几乎可以肯定我在我的应用程序上没有使用任何Url方案我试过找到prefs:root在我的整个项目中通过终端使用grep -R(不区分大小写,也可以匹配App-Prefs或其他什么。

我也使用了很多cocoapods库...所以我的问题是......有没有办法找出哪个库正在使用该权限?

xcode上的搜索结果的屏幕截图

enter image description here

我项目中使用的框架:

  • AmazonFling
  • 来自CocoaPods的许多其他人(未列出,因为无关紧要:请参阅我的回答)
ios xcode cocoapods itunesconnect
6个回答
22
投票

我面临同样的拒绝形式Apple和打开应用程序设置我使用下面的代码,它不被iOS11接受。

let url = URL(string : "prefs:root=")
if UIApplication.shared.canOpenURL(url!) {
    UIApplication.shared.openURL(url!)
 }

因此,要打开“设置”,我使用了以下代码,App已获批准。

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

4
投票

我遇到了同样的问题,我解决了以下问题: -

第1步: - 在你的应用程序中搜索Prefs:root,然后你会发现如下内容: -

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

第2步: - 使用以下代码更改上述代码部分: -

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

现在重建您的应用程序并重新提交到App Store,无后顾之忧:)


2
投票

如果你需要找到'prefs:root is:

转到项目的目标 - >然后信息 - >然后是URL类型,在那里你应该找到值为'prefs'或'prefs:root'的URL Schemes


1
投票

最后,带有问题的是AmazonFling,因为使用其他方法安装,因此未在pod上列出。请参阅论坛帖子:https://forums.developer.amazon.com/questions/167282/apple-app-rejected-because-of-non-public-apis-refe.html

AmazonFling还没有更新(截至2018年4月27日)所以我删除它直到他们更新它。


在AmazonFling 1.3.2中修复,在同一天发布。见https://developer.amazon.com/fr/docs/fling/release-notes.html


1
投票

我遇到了同样的问题。 iOS上不接受“prefs:root =”url方案。使用UIApplicationOpenSettingsURLString值修复它。

Reference Image


-1
投票

要找出正在使用该权限的库,可以在终端中使用此命令

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

如果你在Xcode中搜索没有运气,那么在依赖编译文件中搜索。

© www.soinside.com 2019 - 2024. All rights reserved.