TL;DR Is there a way to download a content from a webapp directly to the mobile's Photo Library?
I have been looking for a way to share an image from my webapp to Instagram. I followed this great comment and tried to implement it.
For me, instagram-stories://share doesn't work (sometimes it opens the editing page and sometimes it doesn't) but I was able to use instagram://library?AssetPath="" - this link opens the "post to instagram" page and takes the last photo you have on your Photo Library.
So I am triggering a download function to download the image to the user device
const generate = async (url) => {
const image = await fetch(url);
const imageBlob = await image.blob();
const imageURL = URL.createObjectURL(imageBlob);
const link = document.createElement('a');
link.href = imageURL;
link.download = 'file-name';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
but it seems like it downloads it to the Download folder (on iPhone IOS 15.5). Then I need to manually save it to the Photo Library - is there a way to download a content from a webapp directly to the Photo Library?