Skip to content

Commit

Permalink
Merge pull request #180 from wymsee/permission-description
Browse files Browse the repository at this point in the history
Permission description
  • Loading branch information
sdushay authored Sep 28, 2016
2 parents 111c97f + 3fe32ab commit b4a756c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ window.imagePicker.getPictures(
// quality of resized image, defaults to 100
quality: int (0-100)
};

### iOS 10 issues

Starting from iOS 10, Apple started asking for specifying the reason for accessing the user’s photo library, therefore it's mandatory to add `NSPhotoLibraryUsageDescription` entry in the info.plist.

[`NSPhotoLibraryUsageDescription`](https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW17) describes the reason that the app accesses the user’s photo library. When the system prompts the user to allow access, this string is displayed as part of the dialog box. In order to add this entry you must pass the variable `PHOTO_LIBRARY_USAGE_DESCRIPTION` on plugin install.

Example:

cordova plugin add cordova-plugin-image-picker --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="your message"`

Empty string will be added as value if you dont pass the variable

### Note for Android Use

Expand Down
6 changes: 6 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@

<!-- ios -->
<platform name="ios">
<preference name="PHOTO_LIBRARY_USAGE_DESCRIPTION" default=" " />

<config-file target="*-Info.plist" parent="NSPhotoLibraryUsageDescription ">
<string>$PHOTO_LIBRARY_USAGE_DESCRIPTION</string>
</config-file>

<config-file target="config.xml" parent="/*">
<feature name="ImagePicker">
<param name="ios-package" value="SOSPicker"/>
Expand Down

0 comments on commit b4a756c

Please sign in to comment.