# Social sharing plugin don't execute some methods

**URL:** <https://forum.ionicframework.com/t/social-sharing-plugin-dont-execute-some-methods/103637>\
**Category:** Ionic Native\
**Created:** [August 29, 2017, 11:31pm UTC](https://forum.ionicframework.com/t/social-sharing-plugin-dont-execute-some-methods/103637 "2017-08-29T23:31:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![temohpab](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@temohpab](https://forum.ionicframework.com/u/temohpab)\
**Post date:** [August 29, 2017, 11:31pm UTC](https://forum.ionicframework.com/t/social-sharing-plugin-dont-execute-some-methods/103637/1 "2017-08-29T23:31:12Z")

</div>

I’ve implemented in my app buttons to share a comment via facebook, twitter, whatsapp, etc…

Whatsapp and twitter works great but if i call to methods facebook o shareapp([googleplus.app.com](http://googleplus.app.com)) the plugin doesn’t works and throws an error if i do a promise.  
Maybe this can be happening because i dont have facebook on my device?  
Anyone can share some code who works? Thanks

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 29, 2017, 11:57pm UTC](https://forum.ionicframework.com/t/social-sharing-plugin-dont-execute-some-methods/103637/2 "2017-08-29T23:57:15Z")

</div>

Share your exact error and `ionic info` output please.

---

<div class="post-metadata">

**Author:** ![temohpab](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@temohpab](https://forum.ionicframework.com/u/temohpab)\
**Post date:** [August 30, 2017, 6:19am UTC](https://forum.ionicframework.com/t/social-sharing-plugin-dont-execute-some-methods/103637/3 "2017-08-30T06:19:41Z")

</div>

```auto
  googlePlus(){
    this.socialSharing.shareVia('plus.google.com', '¡Hi!',
                                    'Imsharingthis.', null, this.shareurl)
      .then(() => {
      console.log('It works');
    }).catch(()=>{
      setTimeout(()=>{
        this.errorShare();
      }, 1500);
    });
  }

  whatsapp(){
    this.socialSharing.shareViaWhatsApp('¡Hi!', null, this.shareurl)
      .then(() => {
        console.log('It works');
      }).catch(()=>{
      setTimeout(()=>{
        this.errorShare();
      }, 1500);
    });
  }

  facebook(){
    // this.socialSharing.shareViaFacebook('Hil', null, this.shareurl);

    this.socialSharing.shareViaFacebookWithPasteMessageHint('Hi!', null, this.shareurl, ' La red social provincial')
      .then(() => {
        console.log('It works');
      }).catch(()=>{
      setTimeout(()=>{
        this.errorShare();
      }, 1500);
    });
  }

  twitter(){
    this.socialSharing.shareViaTwitter('¡HI!, null, this.shareurl)
      .then(() => {
      console.log('It works');
      }).catch(()=>{
      setTimeout(()=>{
        this.errorShare();
      }, 1500);
    });
  }

```

---

<div class="post-metadata">

**Author:** ![temohpab](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@temohpab](https://forum.ionicframework.com/u/temohpab)\
**Post date:** [August 30, 2017, 6:21am UTC](https://forum.ionicframework.com/t/social-sharing-plugin-dont-execute-some-methods/103637/4 "2017-08-30T06:21:55Z")

</div>

Google+ and facebook methods doesn’t works

---

<div class="post-metadata">

**Author:** ![addwebsolution](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/addwebsolution/32/120392_2.png) [@addwebsolution](https://forum.ionicframework.com/u/addwebsolution)\
**Post date:** [August 30, 2017, 6:35am UTC](https://forum.ionicframework.com/t/social-sharing-plugin-dont-execute-some-methods/103637/5 "2017-08-30T06:35:54Z")

</div>

Hi, @temohpab  
Could you try with **shareWithOptions**

`$ ionic plugin add cordova-plugin-x-socialsharing`

component file :

`import { SocialSharing } from 'ionic-native';`

```auto
shareRecipe() {
  SocialSharing.shareWithOptions({
    message: `${this.title} - ${this.description}: ${this.recipeUrl}`
  }).then(() => {
    console.log('Shared!');
  }).catch((err) => {
    console.log('Oops, something went wrong:', err);
  });
}

```

View file :

```auto
 <button ion-button (click)="shareRecipe()">
   <ion-icon name="share"></ion-icon>
 </button>

```

Hope this will solve your Issue. 🙂  
Thanks

---

<div class="post-metadata">

**Author:** ![temohpab](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@temohpab](https://forum.ionicframework.com/u/temohpab)\
**Post date:** [August 30, 2017, 6:42am UTC](https://forum.ionicframework.com/t/social-sharing-plugin-dont-execute-some-methods/103637/6 "2017-08-30T06:42:05Z")

</div>

This could be a solution but i want to share in that specific pages 😕

---

<div class="post-metadata">

**Author:** ![temohpab](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@temohpab](https://forum.ionicframework.com/u/temohpab)\
**Post date:** [August 30, 2017, 6:44am UTC](https://forum.ionicframework.com/t/social-sharing-plugin-dont-execute-some-methods/103637/7 "2017-08-30T06:44:35Z")

</div>

This is my info

```auto
    @ionic/cli-utils : 1.9.2
    ionic (Ionic CLI) : 3.9.2

global packages:

    Cordova CLI : 7.0.1

local packages:

    @ionic/app-scripts : 2.0.2
    Cordova Platforms : android 6.2.3
    Ionic Framework : ionic-angular 3.5.3

System:

    Node : v6.11.2
    npm : 3.10.10 
    OS : Windows 10

```

---

<div class="post-metadata">

**Author:** ![temohpab](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@temohpab](https://forum.ionicframework.com/u/temohpab)\
**Post date:** [August 30, 2017, 6:50am UTC](https://forum.ionicframework.com/t/social-sharing-plugin-dont-execute-some-methods/103637/8 "2017-08-30T06:50:36Z")

</div>

Now facebook it’s working, now only fails with Google+
