Skip to content

Commit

Permalink
Merge pull request #1031 from asgeo1/configurable-photo-usage-descrip…
Browse files Browse the repository at this point in the history
…tion

Add ability to configure the photo library usage descriptions
  • Loading branch information
EddyVerbruggen authored Jun 6, 2019
2 parents 72520b9 + 1f79382 commit d93c92b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,3 +547,13 @@ To address query schema issue, after installaing the plugin you can edit the iOS
```

The advantage with this method is that editing is done in the config.xml file which will most often be in your source control anyway and hence, changes to it will be reserved.

## 9. NSPhotoLibraryUsageDescription on iOS

This plugin requires permissions to the users photos. On iOS 10+, it is required that you provide a description for this access.

The plugin configures a default description for you. If you do need to customise it, you can set a Cordova variable when installing:

```
$ cordova plugin add cordova-plugin-x-socialsharing --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="This app uses your photo library" --variable PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION="This app saves images your photo library"
```
6 changes: 4 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@
</feature>
</config-file>

<preference name="PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION" default="This app requires photo library access to function properly." />
<config-file target="*-Info.plist" parent="NSPhotoLibraryAddUsageDescription">
<string>This app requires photo library access to function properly.</string>
<string>$PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION</string>
</config-file>

<preference name="PHOTO_LIBRARY_USAGE_DESCRIPTION" default="This app requires photo library access to function properly." />
<config-file target ="*-Info.plist" parent="NSPhotoLibraryUsageDescription">
<string>This app requires photo library access to function properly.</string>
<string>$PHOTO_LIBRARY_USAGE_DESCRIPTION</string>
</config-file>

<header-file src="src/ios/NSString+SSURLEncoding.h"/>
Expand Down

0 comments on commit d93c92b

Please sign in to comment.