Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic iOS App store upload error NSPhotoLibraryUsageDescription Key

I have developed an Ionic 2 application. When I try to upload it to the Apple store they reject it with the following message:

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 added the NSPhotoLibraryUsageDescription key in config.xml

<plugin name="cordova-plugin-camera" spec="https://github.com/apache/cordova-plugin-camera">
                <variable name="CAMERA_USAGE_DESCRIPTION" value="App would like to access the camera." />
                <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="App would like to access the library." />
</plugin>

But still they rejected the app with same message. Do I need to add this key in all the plugin variables? I mean I have used image-picker plugin also. Do I need to add this key in this plugin also? I have added that but still they rejected with same error.

like image 491
RaGu Avatar asked Mar 31 '17 04:03

RaGu


3 Answers

Something that worked for me was changing the config.xml

 <platform name="ios">
    <config-file parent="NSPhotoLibraryUsageDescription" platform="ios" target="*-Info.plist">
        <string>You can upload your profile picture using your Photo Library</string>
    </config-file>
    <config-file parent="NSCameraUsageDescription" platform="ios" target="*-Info.plist">
        <string>You can upload your profile picture using your camera</string>
    </config-file>
like image 100
Crisboot Avatar answered Nov 18 '22 04:11

Crisboot


There is two types of info.plist available for Photolibrary.

<variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="App would like to access the library." />
<variable name="PHOTO_LIBRARY_USAGE_DESCRIPTION" value="App would like to access the library." />

Maybe you did not add the second variable in the corresponding plugin. Please add that too. Hopefully it will work.

like image 3
John Avatar answered Nov 18 '22 05:11

John


in platform ios insert the code:

<platform name="ios">

<preference name="CAMERA_USAGE_DESCRIPTION" default=" "/>
<config-file target="*-Info.plist" parent="NSCameraUsageDescription">
  <string>$CAMERA_USAGE_DESCRIPTION</string>
</config-file>
like image 3
Thiago Pires Avatar answered Nov 18 '22 04:11

Thiago Pires