Xcode8打包發佈應用 NSPhotoLibraryUsageDescription

Xcode8 面世啦,升級以後要打包並上傳未完的項目,

但是每次提交之後都是無效版本,這是什麼情況呢。。。

登上QQ郵箱去看下有什麼消息,果然蘋果發來了郵件,

裏面提到了

We have discovered one or more issues with your recent delivery for "xxxxx". To process your delivery, the following issues must be corrected:

Non-public API usage:

  • The app references non-public symbols in ComeToMe: _UICreateCGImageFromIOSurface.........
  • Missing Push Notification Entitlement - Your app includes an API for Apple's Push Notification service, but the aps-environment entitlement is missing from the app's signature.......

什麼意思呢,第一個是說app裏面用私有API UICreateCGImageFromIOSurface了,

好嘛,想起來我app裏面用了reveal ,刪掉;

然後第二個問題說丟失了推送的“Entitlement”,這個是什麼鬼呢,Xcode8有個新的改變,就是你在capabilities裏面開通相應的功能時 bundle裏面多出一個後綴爲‘Entitlement’的文件,那麼,怎麼解決這個問題呢,在證書配置都正確的前提下,把有問題的功能關閉重新打開就行了。

好了問題解決了,打包上傳。。。。

可是這次又是無效版本,我去,再去郵箱看看,額這回又來個郵件:

We have discovered one or more issues with your recent delivery for "xxxxxxxx". To process your delivery, the following issues must be corrected:

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothPeripheralUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

Once these issues have been corrected, you can then redeliver the corrected binary.

什麼意思呢,還記得,在Xcode7剛出世的一個改動嘛,就是必須在infoplist文件裏面加幾個屬性,關於定位的NSLocationWhenInUseUsageDescription NSLocationAlwaysUsageDescription,這回也是這個意思,就是說你得在plist文件裏面加上NSPhotoLibraryUsageDescription(相冊),NSBluetoothPeripheralUsageDescription(藍牙),NSMicrophoneUsageDescription(話筒),NSCameraUsageDescription(攝像頭)的描述,具體value(字符竄)你寫什麼,就看你自己的了。

改完之後,打包上傳,成功!

發佈了253 篇原創文章 · 獲贊 188 · 訪問量 140萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章