Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve "Missing Info.plist key ... NSPhotoLibraryUsageDescription"

Tags:

ios

cordova

I upload my .ipa file completely using application loader but i didn't find the built on Itunes Connect also i receive this message from apple support :"We have discovered one or more issues with your recent delivery for "Update HF". To process your delivery, the following issues must be corrected: Missing Info.plist key - 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. "

i add the following codes to config.xml file but i still have the same error:

like image 323
Ale Avatar asked Jan 12 '17 11:01

Ale


3 Answers

enter image description hereYou can add below lines in your plist.

<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) uses photos</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) uses photos</string>
like image 113
Rahul Saini Avatar answered Nov 12 '22 01:11

Rahul Saini


EDIT: All core plugins have been updated to not use variables anymore. To set the usage descriptions you have to use edit-config tag in the config.xml like this:

<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
    <string>need camera access to take pictures</string>
</edit-config>

See iOS Quirks section

OLD ANSWER: First remove the cordova-plugin-camera with cordova plugin rm cordova-plugin-camera

And then install it again with:

cordova plugin add cordova-plugin-camera --variable PHOTOLIBRARY_USAGE_DESCRIPTION="your usage message"
like image 17
jcesarmobile Avatar answered Nov 12 '22 01:11

jcesarmobile


In my case App Store Connect kept saying that the key was missing even though it was certainly there. After looking at the Info.plist many times, I finally noticed that the NSPhotoLibraryUsageDescription key had an extra space at the end of the key which, apparently, prevents the upload process from seeing the key.

 Here's a screenshot of the problem and solution:

like image 2
Lewis Edward Garrett Avatar answered Nov 12 '22 02:11

Lewis Edward Garrett