Skip to content
This repository was archived by the owner on Jul 24, 2026. It is now read-only.
This repository was archived by the owner on Jul 24, 2026. It is now read-only.

unable to save in IOS -- Security Error 18 #49

Open

Description

@arulapj

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

Activity

  1. changed the title [-]unable to save in IOS8.1[/-] [+]unable to save in IOS8.1 -- Security Error 18[/+] on Jun 8, 2015
  2. changed the title [-]unable to save in IOS8.1 -- Security Error 18[/-] [+]unable to save in IOS -- Security Error 18[/+] on Jun 8, 2015
  3. EdwinRikkers commented on Jul 27, 2015

    @EdwinRikkers

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

  4. beaur commented on Feb 7, 2016

    @beaur

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

  5. beaur commented on Feb 8, 2016

    @beaur

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions