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");
}
};