I am using ionic v4 and the ngx-qrcode library to generate a qrcode. However I also need to download this generated qrcode, but ionic does not perform any action when I click the button on android. In the browser works.
getImage(): void {
const canvas = document.querySelector('canvas') as HTMLCanvasElement;
const imageData = canvas.toDataURL('image/jpeg').toString();
const img = document.createElement('img');
img.src = imageData;
const a = document.createElement('a');
a.setAttribute('download', 'YourFileName.jpeg');
a.setAttribute('href', imageData);
a.appendChild(img);
a.click();
}
At the moment when I click the download button that is in html, it only works if I am in the browser, but in android nothing happens