升級iOS10後訪問相機、相簿、麥克風、通訊錄閃退
阿新 • • 發佈:2019-01-03
升級了iOS10和xcode8,發現訪問相機、相簿、麥克風、藍芽、日曆等時會出現閃退,控制檯給出這樣的資訊:
This app has crashed because it attempted 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中加入NSCameraUsageDescription
通常需要新增如下許可權說明(相機、通訊錄、麥克風、相簿):
Key:NSCameraUsageDescription Type:String Value:cameraDesciption
Key:NSContactsUsageDescription Type:String Value:contactsDesciption
Key:NSMicrophoneUsageDescription Type:String Value:microphoneDesciption
Key:NSPhotoLibraryUsageDescription Type:String Value:photoLibraryDesciption