1. 程式人生 > >ios稽核 "prefs:root="被拒

ios稽核 "prefs:root="被拒

APP提交稽核被拒之後,給出的反饋如下:

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.

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 file an enhancement request.

大致的意思是說我使用了非公開的api, 這些api現在已經不允許使用,原因是這些api若發生變化,會給使用者很不好的體驗。

我查了一下,iOS10之後,這些程式碼就不允許使用了。給出了新的方法:
NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]

NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
}

舊的方法”prefs:root=“在iOS8系統上使用,現在基本上不使用iOS8了,所以可以直接刪除掉就OK了。

在工程中搜索“prefs:root=”程式碼行。
發現是在使用相簿的時候進行了判斷:
在這裡插入圖片描述

修改如下:
在這裡插入圖片描述