web share api
xxxxxxxxxx
share(){
if (navigator.share) {
navigator.share({
// Title that occurs over
// web share dialog
title: 'Share Title',
// URL to share
url: 'https://example.com'
}).then(() => {
console.log('Thanks for sharing!');
}).catch(err => {
// Handle errors, if occured
console.log("Error while using Web share API:");
console.log(err);
});
} else {
// Alerts user if API not available
alert("Browser doesn't support this API !");
}
}