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?
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
- Capacitor
- Cordova
- Enterprise
$ npm install cordova-plugin-x-socialsharing
$ npm install @awesome-cordova-plugins/social-sharing
$ ionic cap sync
$ ionic cordova plugin add cordova-plugin-x-socialsharing
$ npm install @awesome-cordova-plugins/social-sharing
Ionic Enterprise comes with fully supported and maintained plugins from the Ionic Team. Learn More or if you're interested in an enterprise version of this plugin Contact Us
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!
});