Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Add NSPhotoLibraryUsageDescription to info.plist from plugin.xml #26

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# :warning: DISCONTINUED - Cordova base64ToGallery Plugin
This plugin (based on [devgeeks/Canvas2ImagePlugin](http://github.com/devgeeks/Canvas2ImagePlugin)) allows you to save base64 data as a png image into the device (iOS Photo Library, Android Gallery or WindowsPhone 8 Photo Album).

The plugin is a kind of fork of the [solderzzc/Base64ImageSaverPlugin](https://github.com/solderzzc/Base64ImageSaverPlugin) but with a cleaner history (a.k.a: no tags from Canvas2ImagePlugin repo) and a newer iOS implementation.

## Alerts

### Plugin id - [issue #1](https://github.com/Nexxa/cordova-base64-to-gallery/issues/1)
Expand Down
10 changes: 10 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@
</feature>
</config-file>

<preference name="PHOTOLIBRARY_ADD_USAGE_DESCRIPTION" default="This app needs write-access to photo library"/>
<config-file target="*-Info.plist" parent="NSPhotoLibraryAddUsageDescription">
<string>$PHOTOLIBRARY_ADD_USAGE_DESCRIPTION</string>
</config-file>

<preference name="PHOTOLIBRARY_USAGE_DESCRIPTION" default="This app needs read/write-access photo library access"/>
<config-file target="*-Info.plist" parent="NSPhotoLibraryUsageDescription">
<string>$PHOTOLIBRARY_USAGE_DESCRIPTION</string>
</config-file>

<header-file src="src/ios/Base64ToGallery.h"/>
</platform>

Expand Down
2 changes: 1 addition & 1 deletion www/base64ToGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = function(data, options, success, fail) {
var actionArgs = prepareArgs(spec);

// Prepare base64 string
data = data.replace(/data:image\/png;base64,/, '');
data = data.replace(/^data:image\/(jpeg|png|jpg|bmp|gif);base64,/, "");

// And add it to the Service's Action arguments
actionArgs.unshift(data);
Expand Down