Save Canvas image with write file

i am trying following code .

  var dataUrl = this._CANVAS.toDataURL('image/jpeg', 0.7);
     let result = this.file.writeFile(this.file.dataDirectory,'CanvasImages', dataUrl  );
    result.then ( data => {
    }).catch(error => {
      alert("Error" +error);

Canvas image converted to dataUrl. Now trying this code to write image file. But getting error . How to do this please guide.

Hi @sedar, did you solve it? Same issue here.