xcode ios 应用商店拒绝 - 您的应用使用“prefs:root=”非公共 URL 方案
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50040558/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ios app store rejection - Your app uses the "prefs:root=" non-public URL scheme
提问by Noel Carcases
I recently uploaded a new version of my app to itunes connect. My app got rejected with this note
我最近将我的应用程序的新版本上传到了 iTunes Connect。我的应用程序被此注释拒绝
Your app uses the "prefs:root=" non-public URL scheme
您的应用程序使用“prefs:root=”非公共 URL 方案
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.
我几乎可以肯定我没有在我的应用程序上使用任何 Url 方案我已经尝试grep -R
通过终端在我的整个项目中找到 prefs:root (不区分大小写,以便能够匹配 App-Prefs 或其他任何内容。
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?
我也使用了很多 cocoapods 库,所以......我的问题是......有没有办法找出哪个库正在使用该权限?
Screenshot of search results on xcode
在 xcode 上搜索结果的屏幕截图
Frameworks used on my project:
我的项目中使用的框架:
- AmazonFling
- many others from CocoaPods (not listed because irrelevant: see my answer)
- 亚马逊Fling
- 来自 CocoaPods 的许多其他人(未列出,因为无关紧要:请参阅我的答案)
回答by Gurjinder Singh
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.
我遇到了与 Apple 相同的拒绝并打开应用程序设置,我使用的是以下代码,但在 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.
所以,为了打开设置,我使用了下面的代码并且 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)
}
}
回答by Karanvir Singh
I had the same problem and I resolved it as following:-
我遇到了同样的问题,我解决了以下问题:-
Step 1:-Search for the Prefs:rootin your app then you will find something as follows:-
第 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)
}
Step 2:-Change the above code section with the following one:-
第 2 步:-使用以下代码更改上述代码部分:-
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 :)
现在重建您的应用程序并重新提交到 App Store,无需担心:)
回答by Nandun Thilina Bandara
I faced the same issue. "prefs:root=" url scheme is not accepted by iOS 11. Using the UIApplicationOpenSettingsURLStringvalue fixed it.
我遇到了同样的问题。“prefs:root=" url 方案不被 iOS 11 接受。使用UIApplicationOpenSettingsURLString值修复了它。
回答by Rupak Shakya
if you need to find with the 'prefs:root is:
如果您需要使用 'prefs:root 查找是:
Go to your project's target -> then Info -> then URL Types, there you should find URL Schemes with value like 'prefs' or 'prefs:root'
转到您项目的目标 -> 然后是信息 -> 然后是 URL 类型,在那里您应该找到具有像 'prefs' 或 'prefs:root' 这样的值的 URL Schemes
回答by Noel Carcases
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,它没有列在 pod 上,因为它是使用另一种方法安装的。请参阅有关它的论坛帖子: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.
AmazonFling 尚未更新(截至 2018 年 4 月 27 日),因此我将其删除,直到他们更新为止。
Fixed in AmazonFling 1.3.2, released on the same day. See https://developer.amazon.com/fr/docs/fling/release-notes.html
已在 AmazonFling 1.3.2 中修复,同日发布。请参阅https://developer.amazon.com/fr/docs/fling/release-notes.html
回答by Lucky Mehndiratta
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)
}
回答by Cristina De Rito
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.
搜索依赖项编译的文件,如果你在 Xcode 中搜索没有运气。