Published on: 26 September, 2017

Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description

Posted by andy | 275 views 0 likes 0 favourites 0 comments
Tumblr Digg Google Plus

In the email, I received the following message The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data. It means when you install a plugin you have to include a variable parameter to pass the usage description.

There are two ways to fix this issue. The first way is to un-install and re-install the plugin again. In my case of using the cordova camera plugin, it will be like below.

cordova plugin remove cordova-plugin-camera

Then you can re-install it again using the following command.

cordova plugin add cordova-plugin-camera --variable CAMERA_USAGE_DESCRIPTION="your usage message" --variable PHOTOLIBRARY_USAGE_DESCRIPTION="your usage message"

Once it has been re-installed, in your config.xml file, it will have the following configuration.

<plugin name="cordova-plugin-camera" spec="~2.2.0">
        <variable name="CAMERA_USAGE_DESCRIPTION" value="my message" />
        <variable name="NSPHOTOLIBRARYUSAGEDESCRIPTIONENTRY" value="my message" />
</plugin>

The second way can be done via XCode program. If you open your project app in XCode, go to File Menu > Open Quickly.

Then enter the keyword Info.plist in the keyword search. It should list like below list.

You then need to select a file name with the following pattern Your App Name-Info.plist. Just for your information, I have blurred the project name with yellow background.

If you double click the file, it will be opened in Standard Editor format, it will be list in a table format. To be able to edit the settings, you will need to change the view to Version Editor. See the following image icon to change it.

Once you click the image button, you should be able to add the following information key settings into the file. Just place the usage key and description under <dict>. There is no restriction to put it where it just need to be inside the <dict> root.

<key>NSCameraUsageDescription</key>
<string>My App requires access to the camera</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>My App requires access to the photo library</string>

Comments

There are no comments available.

Write Comment
0 characters entered. Maximum characters allowed are 1000 characters.
Share your article with us and add your own google adsense account to earn extra money. Plus, you can promote a link back to your site.
Related Articles
Published on: 21 September, 2017
If you are new to Cordova and about to learn to program your first mobile app. You might want to know how to install, remove or view plugins for your app. So why you do need a plugin? Plugins in cordova is considered as a component or a module created to be used to access Native API of your phone. For example if you need to access your phone camera, you will need a camera cordova plugin which is cordova-plugin-camera. There are heaps of available plugin created by developers, you just need to try and test them so it works according to your need.
Published on: 18 September, 2017
This is the second part tutorial of our first ebook cordova tutorial. If you miss the first part of the tutorial, I would recommend you to read the first tutorial before continue reading this article. You can click the following link to read the first tutorial. As I promised, in this tutorial, you will learn how to package your ebook app into .apk file. The first thing you have to do is to configure your application configuration setting xml file. This configuration information is used by Cordova to package your application. The configuration xml file is located under the root folder named config.xml. If you open your config xml file using any text editor, you will have the following information.
Published on: 08 August, 2017
You will learn how to create your first android app using Cordova. The ebook will consists of 5 basic pages and will use AngularJS for the navigation, Slideout script for the menu navigation and Bootstrap template for the basic mobile layout.
Published on: 11 July, 2016
Are you completely new to Cordova programming? If you visit the cordova site and follow the example step by step. On the time you create the project and try to add a platform, if you forget to navigate to the your project name directory and you set your preference platform. You will receive the following error message Current working directory is not a Cordova based project..