4

I am using Xcode 9.2 and I have gone many threads on this topic and still no solution. I want to use the iphone camera so I set the NSCameraUsageDescription as this enter image description here and still the app crashes with this error message

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.

How should I set the NSCameraUsageDescription ?

Cœur
  • 37,241
  • 25
  • 195
  • 267
jone2
  • 191
  • 1
  • 4
  • 18
  • You already seem to have it though the value is inappropriate. You need a short explanation of why your app wants camera access. The user will already know that it wants access and it will already know the app name. – rmaddy May 14 '18 at 22:25
  • @rmaddy so the value for camera usage explanation should be longer? – jone2 May 14 '18 at 22:35
  • It should be useful. iOS will display an alert stating something like "App XXX is requesting access to the camera". This will be followed by the value you put in the Info.plist and then the Allow and Deny buttons. So your message should be a sentence telling the user why your app needs to access the camera. – rmaddy May 14 '18 at 22:42
  • @rmaddy Ok, but why is it crashing and displaying the error message when the value is already entered? – jone2 May 14 '18 at 22:48
  • Does it crash when you replace `$(PRODUCT_NAME) camera use` with something more guidelines friendly, like `We will use your photos for illustrations.`? – Cœur May 17 '18 at 11:39

1 Answers1

1

Like @rmaddy says, write the description for camera usage explanation.

BatyrCan
  • 6,773
  • 2
  • 14
  • 23