xcode8 iOS10上關于NSPhotoLibraryUsageDescription NSCameraUsageDescription 等問題

iOS 10出來之后,真是很多坑啊,填完一個又來一個,今天又遇到了一個,用Xcode8.0上傳項目時被駁回說是info.plist里面沒有設置NSPhotoLibraryUsageDescription、NSCameraUsageDescription、NSContactsUsageDescription、NSMicrophoneUsageDescription等字段,之前這些都是預設的不用加,現(xiàn)在強制了,真是郁悶,下面貼上解決方案

被駁回的原因:

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 NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

意思就是得在plist里面必須加上NSPhotoLibraryUsageDescription和NSCameraUsageDescription的鍵值對才行,之前都是默認的,現(xiàn)在必須加,要不不讓通過,具體配置如下圖:

info.png

也可以找到項目的info.plist文件,右擊選中Open As -> source code 添加如下代碼:
相機權限描述:

<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>

通信錄:

<key>NSContactsUsageDescription</key>
<string>contactsDesciption</string>

麥克風:

<key>NSMicrophoneUsageDescription</key>
<string>microphoneDesciption</string>

相機:

<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>

其中,如果把<string>photoLibraryDesciption</string>中間photoLibraryDesciption去掉也可以,個人覺得更加簡潔好看。

就這樣就解決權限問題啦,不過如果實在還不行,你可以試試Clean,再運行就OK啦

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容