I have been working on a function to download div as an image using html-to-image library. It works well on android phone, but using IOS phones, it only downloads the text and skips the images. Please How do I address this ?
Here is my download function for IOS.
async function IosDownloadImages(){
try{
let dataUrl = await htmlToImage.toJpeg(downloadable.current);
setTimeout(function(){
console.log(dataUrl)
setDownloadStage(86);
const U = document.createElement('a');
let ran = randomNumberInRange(0,999);
U.download = "Image"+ran;
setDownloadStage(90);
U.href = dataUrl;
U.click();
return "success";
},2500);
}catch(e){
return e;
}
}
Try this :