Share application option

Hi,
i am trying to add one option to share my application

i tried this but everytime its going into error part only,
please help
thanks in advance

What did you exactly try, how does your code look like and what does the error look like?

1 Like

I have the same question,

I tried this :

 this.socialSharing.shareWithOptions( {
         message: "",
         subject: "",
         url: "",
     }).then((data) =>
     {
       console.log('Shared via SharePicker' + data);
     })
     .catch((err) =>
     {
       console.log('Was not shared via SharePicker' + err);

     })
     ;

I expect “data” to be an object with some helpful data in it, right now what I get is only [True/False] [1/0] feedback.

What does that mean?

Actually I only got 1, so I think it meant “Success” :[

is https://ionicframework.com/docs/native/social-sharing/?

The docs don’t mention data at all. What does it log after “Share via SharePicker”?

the link i provided, i did the code exactly the same, but when i am clicking in the button it’s showing cordova not available in the error part
and as i checked i have cordova installed

Are you running on browser? cordova plugins will only work on device

1 Like

I got an answer to this:

import social sharing and pass it to constructor. then :

 
 this.socialSharing.shareWithOptions(
       { message: " @amaniapp ",
       url: "https://amaniapp.net"} )
     .then((result) =>
     {
       this.analytics.trackEvent("Share Success" , result.app);
     })
     .catch((err) =>
     {
       this.analytics.trackEvent("Share Fail" , JSON.stringify(err));
     })
     ;