You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2016/08/25 23:17:48 UTC

cordova-plugin-camera git commit: CB-11661: (ios) Add mandatory iOS 10 privacy description

Repository: cordova-plugin-camera
Updated Branches:
  refs/heads/master c98607c61 -> a3af38ad5


CB-11661: (ios) Add mandatory iOS 10 privacy description


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/a3af38ad
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/a3af38ad
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/a3af38ad

Branch: refs/heads/master
Commit: a3af38ad5b3d826216f2538bd9aad5d217df4a12
Parents: c98607c
Author: mhartington <mi...@gmail.com>
Authored: Thu Aug 11 15:22:39 2016 -0400
Committer: Steve Gill <st...@gmail.com>
Committed: Thu Aug 25 16:17:28 2016 -0700

----------------------------------------------------------------------
 README.md  | 54 ++++++++++++++++++++++++++++++++----------------------
 plugin.xml |  5 +++++
 2 files changed, 37 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/a3af38ad/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index a15680c..9f37f9a 100644
--- a/README.md
+++ b/README.md
@@ -50,6 +50,16 @@ It is also possible to install via repo url directly ( unstable )
 
     cordova plugin add https://github.com/apache/cordova-plugin-camera.git
 
+### iOS Quirks
+
+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\u2019s 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 `CAMERA_USAGE_DESCRIPTION` on plugin install.
+
+Example:
+`cordova plugin add cordova-plugin-camera --variable CAMERA_USAGE_DESCRIPTION="your usage message"`
+
+If you don't pass the variable, the plugin will add an empty string as value.
 
 ## How to Contribute
 
@@ -68,8 +78,8 @@ In order for your changes to be accepted, you need to sign and submit an Apache
 
 ## This documentation is generated by a tool
 
-:warning: Run `npm install` in the plugin repo to enable automatic docs generation if you plan to send a PR.  
-[jsdoc-to-markdown](https://www.npmjs.com/package/jsdoc-to-markdown) is used to generate the docs.  
+:warning: Run `npm install` in the plugin repo to enable automatic docs generation if you plan to send a PR.
+[jsdoc-to-markdown](https://www.npmjs.com/package/jsdoc-to-markdown) is used to generate the docs.
 Documentation consists of template and API docs produced from the plugin JS code and should be regenerated before each commit (done automatically via [husky](https://github.com/typicode/husky), running `npm run gen-docs` script as a `precommit` hook - see `package.json` for details).
 
 
@@ -152,7 +162,7 @@ __Supported Platforms__
 
 More examples [here](#camera-getPicture-examples). Quirks [here](#camera-getPicture-quirks).
 
-**Kind**: static method of <code>[camera](#module_camera)</code>  
+**Kind**: static method of <code>[camera](#module_camera)</code>
 
 | Param | Type | Description |
 | --- | --- | --- |
@@ -160,7 +170,7 @@ More examples [here](#camera-getPicture-examples). Quirks [here](#camera-getPict
 | errorCallback | <code>[onError](#module_camera.onError)</code> |  |
 | options | <code>[CameraOptions](#module_camera.CameraOptions)</code> | CameraOptions |
 
-**Example**  
+**Example**
 ```js
 navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
 ```
@@ -176,8 +186,8 @@ __Supported Platforms__
 
 - iOS
 
-**Kind**: static method of <code>[camera](#module_camera)</code>  
-**Example**  
+**Kind**: static method of <code>[camera](#module_camera)</code>
+**Example**
 ```js
 navigator.camera.cleanup(onSuccess, onFail);
 
@@ -194,7 +204,7 @@ function onFail(message) {
 ### camera.onError : <code>function</code>
 Callback function that provides an error message.
 
-**Kind**: static typedef of <code>[camera](#module_camera)</code>  
+**Kind**: static typedef of <code>[camera](#module_camera)</code>
 
 | Param | Type | Description |
 | --- | --- | --- |
@@ -205,13 +215,13 @@ Callback function that provides an error message.
 ### camera.onSuccess : <code>function</code>
 Callback function that provides the image data.
 
-**Kind**: static typedef of <code>[camera](#module_camera)</code>  
+**Kind**: static typedef of <code>[camera](#module_camera)</code>
 
 | Param | Type | Description |
 | --- | --- | --- |
 | imageData | <code>string</code> | Base64 encoding of the image data, _or_ the image file URI, depending on [`cameraOptions`](#module_camera.CameraOptions) in effect. |
 
-**Example**  
+**Example**
 ```js
 // Show image
 //
@@ -226,7 +236,7 @@ function cameraCallback(imageData) {
 Optional parameters to customize the camera settings.
 * [Quirks](#CameraOptions-quirks)
 
-**Kind**: static typedef of <code>[camera](#module_camera)</code>  
+**Kind**: static typedef of <code>[camera](#module_camera)</code>
 **Properties**
 
 | Name | Type | Default | Description |
@@ -258,7 +268,7 @@ _Note:_ On iOS passing `DestinationType.NATIVE_URI` along with
 disable any image modifications (resize, quality change, cropping, etc.) due
 to implementation specific.
 
-**Kind**: static enum property of <code>[Camera](#module_Camera)</code>  
+**Kind**: static enum property of <code>[Camera](#module_Camera)</code>
 **Properties**
 
 | Name | Type | Default | Description |
@@ -270,7 +280,7 @@ to implementation specific.
 <a name="module_Camera.EncodingType"></a>
 
 ### Camera.EncodingType : <code>enum</code>
-**Kind**: static enum property of <code>[Camera](#module_Camera)</code>  
+**Kind**: static enum property of <code>[Camera](#module_Camera)</code>
 **Properties**
 
 | Name | Type | Default | Description |
@@ -281,7 +291,7 @@ to implementation specific.
 <a name="module_Camera.MediaType"></a>
 
 ### Camera.MediaType : <code>enum</code>
-**Kind**: static enum property of <code>[Camera](#module_Camera)</code>  
+**Kind**: static enum property of <code>[Camera](#module_Camera)</code>
 **Properties**
 
 | Name | Type | Default | Description |
@@ -298,7 +308,7 @@ _Note:_ On iOS passing `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SA
 along with `DestinationType.NATIVE_URI` will disable any image modifications (resize, quality
 change, cropping, etc.) due to implementation specific.
 
-**Kind**: static enum property of <code>[Camera](#module_Camera)</code>  
+**Kind**: static enum property of <code>[Camera](#module_Camera)</code>
 **Properties**
 
 | Name | Type | Default | Description |
@@ -312,21 +322,21 @@ change, cropping, etc.) due to implementation specific.
 ### Camera.PopoverArrowDirection : <code>enum</code>
 Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
 
-**Kind**: static enum property of <code>[Camera](#module_Camera)</code>  
+**Kind**: static enum property of <code>[Camera](#module_Camera)</code>
 **Properties**
 
 | Name | Type | Default |
 | --- | --- | --- |
-| ARROW_UP | <code>number</code> | <code>1</code> | 
-| ARROW_DOWN | <code>number</code> | <code>2</code> | 
-| ARROW_LEFT | <code>number</code> | <code>4</code> | 
-| ARROW_RIGHT | <code>number</code> | <code>8</code> | 
-| ARROW_ANY | <code>number</code> | <code>15</code> | 
+| ARROW_UP | <code>number</code> | <code>1</code> |
+| ARROW_DOWN | <code>number</code> | <code>2</code> |
+| ARROW_LEFT | <code>number</code> | <code>4</code> |
+| ARROW_RIGHT | <code>number</code> | <code>8</code> |
+| ARROW_ANY | <code>number</code> | <code>15</code> |
 
 <a name="module_Camera.Direction"></a>
 
 ### Camera.Direction : <code>enum</code>
-**Kind**: static enum property of <code>[Camera](#module_Camera)</code>  
+**Kind**: static enum property of <code>[Camera](#module_Camera)</code>
 **Properties**
 
 | Name | Type | Default | Description |
@@ -367,7 +377,7 @@ __Supported Platforms__
 
 - iOS
 
-**Example**  
+**Example**
 ```js
 navigator.camera.getPicture(onSuccess, onFail,
 {

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/a3af38ad/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 99769ab..0911fb8 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -150,6 +150,11 @@
          <framework src="CoreGraphics.framework" />
          <framework src="AVFoundation.framework" />
 
+         <preference name="CAMERA_USAGE_DESCRIPTION" default=" " />
+         <config-file target="*-Info.plist" parent="NSCameraUsageDescription">
+             <string>$CAMERA_USAGE_DESCRIPTION</string>
+         </config-file>
+
          <config-file target="*-Info.plist" parent="NSLocationWhenInUseUsageDescription">
              <string></string>
          </config-file>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org