Identify the app to which user share using Webshare api

314 Views Asked by At

I am using webshare api in my app basically mobile browser. So far i am able to list the apps on my phone and share to a selected app. Is there a way to identify in response (then block) to which app it was shared.

here is the sample code

if (navigator.share) { 
   navigator.share({ 
      title: 'Hello world', 
      text: 'This is a sample description', 
      url: '', }) 
   .then(() => console.log('Successful share'))
   .catch((error) => console.log('Error sharing',       error)); 
}else{ 
// Your fall back code here
 }
1

There are 1 best solutions below

0
On

This is not currently possible with the Web Share API (albeit Android has an API that has info which app something was shared to).