Cordova + iOS 10: NSCameraUsageDescription missing

Ronny Roeller
NEXT Engineering
Published in
1 min readSep 28, 2016

We upgraded our development environments to iOS 10. Creating the iOS release via Cordova worked without issues. But as soon as we submitted the release to the App Store, we receive the following error email from Apple:

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.

The same happened for NSCameraUsageDescription, NSMicrophoneUsageDescription and NSPhotoLibraryUsageDescription, which all became mandatory entries in info.plist as of iOS 10.

Luckily, the Cordova community created already a solution: The cordova-plugin-media-capture can generate the required entries for you! All you need to do is upgrade cordova-plugin-media-capture to the latest version and pass the following variables in the config.xml of your project:

<plugin name="cordova-plugin-media-capture" source="npm" spec="*">
<variable name="CAMERA_USAGE_DESCRIPTION" value="App would like to access the camera." />
<variable name="MICROPHONE_USAGE_DESCRIPTION" value="App would like to access the microphone." />
<variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="App would like to access the library." />
</plugin>

Happy coding!

Want to learn more about coding? Have a look to our other articles.

Photo: Hugh Grew

--

--

Ronny Roeller
NEXT Engineering

CTO at nextapp.co # Product discovery platform for high performing teams that bring their customers into every decision