Ale
Ale

Reputation: 161

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

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:

Upvotes: 12

Views: 35221

Answers (5)

Lewis Edward Garrett
Lewis Edward Garrett

Reputation: 171

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:

Upvotes: 2

vishal rana
vishal rana

Reputation: 1

I encounter the same problem. Try using the below code in your config.xml

<gap:config-file platform="ios" parent="NSPhotoLibraryUsageDescription">

This might be a late response for you but hope this works for people in future.

Upvotes: 0

TechSavvySam
TechSavvySam

Reputation: 1442

I'm using VS TACO and this is how I finally resolved this issue. Edit the \plugins\fetch.json file so the "cordova-plugin-camera" adding the "variables" section:

"cordova-plugin-camera": {
    "source": {
        "type": "registry",
        "id": "cordova-plugin-camera@~2.4.1"
    },
    "is_top_level": true,
    "variables": {
        "CAMERA_USAGE_DESCRIPTION": "your description text here",
        "PHOTOLIBRARY_USAGE_DESCRIPTION": "your description text here"
    }
}

Upvotes: 0

jcesarmobile
jcesarmobile

Reputation: 53301

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"

Upvotes: 17

Rahul Saini
Rahul Saini

Reputation: 921

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>

Upvotes: 22

Related Questions