-1

web share api not working in safari ios 16

here's my function and i want it to works only when clicking a button and pass the parameter i want to share

  if (navigator.share) {
    navigator
      .share({
        text: text,
        url: "https://example.com",
        title: "hi",
      })
      .then(() => alert(text))
      .catch((error) => alert("Sharing failed", error));
  } else {
    alert("eror");
  }
};
mofarih-dev
  • 55
  • 1
  • 7

1 Answers1

0

Have you had a chance to look into this question? Looks like it could be helpful.