From 7acf38b6c43382acb81fa621c7da1d3b211a5ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Menich?= Date: Mon, 12 Dec 2016 16:04:45 -0300 Subject: [PATCH] (ios) Added variable for setting NSCameraUsageDescription --- README.md | 17 ++++++++++------- plugin.xml | 6 ++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3e30d22..7852909 100755 --- a/README.md +++ b/README.md @@ -54,15 +54,18 @@ The card.io Cordova Plugin adds support for the CardIO iOS and android platform. 1. Follow Your app integration section below. 2. Run `cordova run ios` or `cordova run android` to build and the project. -Note: For use with iOS 10 + -When building your app with the iOS 10 SDK +, you have to add some info to the info.plist file. This is due to increased security in iOS 10. Go to your app directory and search for the <your app name>Info.plist file. Add the following lines in the main <dict> element. +## iOS Quirks -```xml - NSCameraUsageDescription - To scan credit cards. -``` +Since iOS 10 it's mandatory to add a `NSCameraUsageDescription` entry in the info.plist. + +`NSCameraUsageDescription` describes the reason that the app accesses the user's camera. + +When the system prompts the user to allow access, this string is displayed as part of the dialog box. To add this entry you can pass the variable `CARD_IO_CAMERA_USAGE_DESCRIPTION` on plugin install. + +Example: +`cordova plugin add https://github.com/card-io/card.io-Cordova-Plugin --variable CARD_IO_CAMERA_USAGE_DESCRIPTION="your usage message"` -If you have a different way to edit .plist files - plugins etc. - you can do that. +If you don't pass the variable, the plugin will add a default string as value. Sample HTML + JS ---------------- diff --git a/plugin.xml b/plugin.xml index 7dca14a..8054794 100644 --- a/plugin.xml +++ b/plugin.xml @@ -57,6 +57,12 @@ + + + + $CARD_IO_CAMERA_USAGE_DESCRIPTION + +