I just want to activate native apps, when clicking on the "share" button on my PWA (Progressive Web App) but it shows the following error
TypeError: Cannot read property 'apply' of undefined
I am using Nuxt Js
This is My code
function tshareData(i) {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|OperaMini/i.test(
navigator.userAgent)
) {
try {
let y = document.getElementById("sharetable" + i).innerText;
const shareData = {
title: "List",
text: y,
url: window.location.href
};
navigator
.share(...shareData)
.then(() => console.log("Successful share"))
.catch(error => {
console.log(error);
});
} catch (error) {
console.log("Catch Error", error);
}
} else {
alert("Browser Not Suported");
}
}