被拒原文:
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.
Specifically, your app uses the following non-public URL scheme:app-prefs:root=privacy&path=location 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.
Next Steps
To resolve this issue, please revise your app to provide the associated functionality using public APIs or remove the functionality using the "prefs:root" or "App-Prefs:root" URL scheme.
If there are no alternatives for providing the functionality your app requires, you can useFeedback Assistantto submit an enhancement request.
大致翻译:
准则2.5.1-性能-软件要求
您的应用程序使用“ prefs:root =“非公共URL方案,这是一个私有实体。 在App Store上不允许使用非公共API,因为如果这些API发生更改,可能会导致不良的用户体验。
具体来说,您的应用程序使用以下非公开URL方案:app-prefs:root = privacy&path = location future在以后提交此应用程序时继续使用或隐藏非公开API可能会导致您的Apple Developer帐户也被终止 从App Store中删除所有关联的应用程序。 后续步骤要解决此问题,请修改您的应用程序以使用公共API提供相关功能,或使用“ prefs:root”或“ App-Prefs:root” URL方案删除该功能。 如果没有其他方法可提供您的应用程序所需的功能,则可以使用“反馈助手”提交增强请求。
解决方案:
将打开设置-隐私-定位服务 这个私有方法:
let urlStr = "App-Prefs:root=Privacy&path=LOCATION"
UIApplication.shared.openURL(urlStr)
改成: let urlStr = UIApplicationOpenSettingsURLString
UIApplication.shared.openURL(urlStr)
当然,肯定还有调用其他的私有方法被拒2.5.1,只能修改成当前可用的方法。
扩展解决方案(没有真实测试):
采用接口的方式,将私有方法的字符串通过接口获取,然后使用openURL(urlStr)打开,没有在本地涉及到私有方法的名字,应该是可以的。