sharing image to facebook using navigator.share on Safari (iOS)

Hi,
I'm trying to share an image to facebook using navigator.share. It works totally fine on Android, but it doesn't work on Safari, iOS. On iOS, it looks like I was sharing text instead of an image. Here's the snippet.
Code Block
let blob = await fetch(
document.getElementById("imagetag").src
).then((r) => r.blob());
let file = new File([blob], "googleimage.png", {
type: "image/png",
});
try {
await navigator.share({
files: [file],
title: "test share Image"
});
console.log("share successful");
} catch (err) {
console.log(`Your system doesn't support sharing files. ${err}`);
}

Hello 👋🏼

Any solution for this issue? I’m trying to share an image thumbnail file and posting it to instagram. It works on android but ios safari doesn’t.

I was having the same issue when sharing to Whatsapp. My solution was to send a blank title:

    var data = {
      title: '',
      files: [file],
    };

    navigator.share(data).then();

That did the trick for me.

sharing image to facebook using navigator.share on Safari (iOS)
 
 
Q