devgeeks/Canvas2ImagePlugin

unable to save in IOS -- Security Error 18

Opened this issue · 3 comments

Hi,

trying to use this plugin for ios, its working in android but not in ios, please note i am using phonegap build to compile ipa

code

index.html

script.js
[code]
function uploadImage(rul) {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
var imageObj = new Image();
imageObj.src = rul;
imageObj.onload = function () {
try{
canvas.width = imageObj.width;
canvas.height = imageObj.height;
context.drawImage(imageObj, 0, 0);
window.canvas2ImagePlugin.saveImageDataToLibrary(
function(msg){
alert(JSON.stringify(msg));
},
function(err){
alert(JSON.stringify(err));
},
document.getElementById('myCanvas')
);
}catch(e){alert("ERROR:"+JSON.stringify(e));}
};
}
uploadImage("http://icdn.indiaglitz.com/hindi/gallery/Actress/PriyankaChopra/Priyanka_Chopra_8615_218.jpg");

[/code]

config.xml

<gap:plugin name="org.devgeeks.canvas2imageplugin" version="0.6.0" source="plugins.cordova.io" />

i am getting following error when excuted
{"code":18,"name":"SecurityError", "message":"SecurityError: DOM Exception 18","line":22,"column":45,"sourceURL":"file:///private/var/mobile/Containers/Data..../www/plugins/../Canvas2ImagePlugin.js"}

the same thing worked for android

+1 for this issue... any known workaround for this ????

beaur commented

+1 having the same issue here. Is there a solution?

beaur commented

Seems the issue only appears if using the WKWebView plugin. I've disabled that for now but hopefully there is a workaround.