Xcode8以上 info.plist 系統權限問題

更新Xcode8以后(iOS10),App使用相機,相冊,麥克風,定位等等之類的系統權限時,需要在info.plist中增加相關配置,不然在編譯的時候,會閃退...
  • 相機NSCameraUsageDescription
  • 相冊NSPhotoLibraryUsageDescription
  • 通訊錄NSContactsUsageDescription
  • 始終訪問位置NSLocationAlwaysUsageDescription
  • 位置NSLocationUsageDescription
  • 在使用期間訪問位置NSLocationWhenInUseUsageDescription
  • 麥克風NSMicrophoneUsageDescription
  • 訪問藍牙NSBluetoothPeripheralUsageDescription
  • 訪問日歷NSCalendarsUsageDescription
  • 訪問媒體資料庫NSAppleMusicUsageDescription
  • 訪問健康分享NSHealthShareUsageDescription
  • 訪問健康更新NSHealthUpdateUsageDescription
  • 訪問運動與健身NSMotionUsageDescription
  • 訪問提醒事項NSRemindersUsageDescription
PS:分享一下筆者在開發中遇到的錯誤:
This app has crashed because it attempted 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.
  • 解決辦法:

相機權限
<key>NSCameraUsageDescription<key>
<string>cameraDesciption<string>
相冊權限
<key>NSPhotoLibraryUsageDescription<key>
<string>photoLibraryDesciption<string>

如果問題或錯誤,歡迎大家留言
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容