1

Plugin is ::

  • ionic cordova plugin add cordova-base64-to-gallery
  • npm install @ionic-native/base64-to-gallery

When I saved a image into gallery then show this error “Error while saving image”

Code ::

downloadQR(){  
const canvas = document.querySelector(‘canvas’) as HTMLCanvasElement;  
const imageData = canvas.toDataURL(‘image/jpeg’).toString()  
console.log(imageData)  
let data = imageData.split(’,’)[1];  
console.log(data)  
this.base64.base64ToGallery(data, {  
prefix:’_img’,mediaScanner : true}).then(async res=>{  
console.log(res)  
let toast = await this.toastCtrl.create({  
header : ‘QR code save’  
})  
toast.present()  
}, err => console.log(“err”,err)  
)  
}  

What is problem of my code? any other solution ??

0 Answers0