Skip to main content
Version: v5

Social Sharing

Share text, files, images, and links via social networks, sms, and email.

For Browser usage check out the Web Share API docs: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin#5-web-share-api

https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin

Stuck on a Cordova issue?

Don't waste precious time on plugin issues.

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.

Installation

$ npm install cordova-plugin-x-socialsharing 
$ npm install @awesome-cordova-plugins/social-sharing
$ ionic cap sync

Supported Platforms

  • Android
  • Browser
  • iOS
  • Windows
  • Windows Phone

Usage

React

Learn more about using Ionic Native components in React

Angular

import { SocialSharing } from '@awesome-cordova-plugins/social-sharing/ngx';

constructor(private socialSharing: SocialSharing) { }

...

// Check if sharing via email is supported
this.socialSharing.canShareViaEmail().then(() => {
// Sharing via email is possible
}).catch(() => {
// Sharing via email is not possible
});

// Share via email
this.socialSharing.shareViaEmail('Body', 'Subject', ['recipient@example.org']).then(() => {
// Success!
}).catch(() => {
// Error!
});