Share application option


#1

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


#2

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


#3

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.


#4

What does that mean?


#5

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


#6

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

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


#7

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


#8

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


#9

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