> For the complete documentation index, see [llms.txt](https://enappd.gitbook.io/capacitor-full-app-ionic-angular/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://enappd.gitbook.io/capacitor-full-app-ionic-angular/features/pro-features/pro-addons/social-sharing.md).

# Social Sharing

Every app requires sharing in one way or another. [Social Sharing](https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin) plugin allows you to use the native sharing window of your mobile device.

* Works on Android, version 2.3.3 and higher (probably 2.2 as well).
* Works on iOS6 and up.
* Works on Windows Phone 8 since v4.0 of this plugin (maybe even WP7, but I have no such test device).
* Share text, a link, a images (or other files like pdf or ics). Subject is also supported, when the receiving app supports it.
* Supports sharing files from the internet, the local filesystem, or from the www folder.
* You can skip the sharing dialog and directly share to Twitter, Facebook, or other apps.

#### Install the plugin

```
$ ionic cordova plugin add cordova-plugin-x-socialsharing
$ npm install @ionic-native/social-sharing
```

and import the plugin in your pages

```
import { SocialSharing } from '@ionic-native/social-sharing/ngx';

constructor(private socialSharing: SocialSharing) { }
```

In Capacitor Full App, this plugin's implementation can be found at `src/app/pages/pro/social-share`&#x20;

![](/files/-LucDH0Ixg83OQ_TzVPw)

#### Sharing with Whatsapp

```
this.socialSharing.shareViaWhatsApp(text, image, url).then((res) => {
  // Success
}).catch((e) => {
  // Error!
});
```

You can share text, images or url. If any data is missing, use `null` in its place.

#### Sharing with Instagram

```
this.socialSharing.shareViaInstagram(text, image).then((res) => {
  // Success
}).catch((e) => {
  // Error!
});
```

#### Sharing with Facebook

```
this.socialSharing.shareViaFacebook(text, image, url).then((res) => {
  // Success
}).catch((e) => {
  // Error!
});
```

Text may be ignored by Facebook, as it often does not allow preset text to be filled in Facebook posts or shares.

#### Sharing with Twitter

```
this.socialSharing.shareViaTwitter(text, image, url).then((res) => {
  // Success
}).catch((e) => {
  // Error!
});
```

#### Sharing with Email

Check if email sharing is possible

```
this.socialSharing.canShareViaEmail().then((res) => {
  // Success
}).catch((e) => {
  // Error!
});
```

And then share with email

```
this.socialSharing.shareViaEmail(body, subject, ['recipient@example.org']).then((res) => {
  // Success
}).catch((e) => {
  // Error!
})
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://enappd.gitbook.io/capacitor-full-app-ionic-angular/features/pro-features/pro-addons/social-sharing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
