
iOSでカメラにアクセスする際のInfo.plistの書き方
iOSでカメラにアクセスする際のInfo.plistの書き方
環境
- Swift
- Swift3
- Xcode
- Xcode9
- NSMicrophoneUsageDescription
- Info.plist
エラー内容
[access] This app has crashed because it attempted 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.解決方法
info.plistを右クリック -> Open As -> Source Code でソースでかけるようにする
下記のようにコピペ
<key>NSMicrophoneUsageDescription</key>
<string>Need microphone access for uploading videos</string>
<key>NSCameraUsageDescription</key>
<string>Need camera access for uploading Images</string>
<key>NSLocationUsageDescription</key>
<string>Need location access for updating nearby friends</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app will use your location to show you cool stuff near you.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>NeedLibrary access for uploading Images</string>
元のリストに戻したければ