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 @ionic-native/social-sharing $ ionic cap sync
$ ionic cordova plugin add cordova-plugin-x-socialsharing $ npm install @ionic-native/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#
ReactLearn more about using Ionic Native components in React
#
Angularimport { SocialSharing } from '@ionic-native/social-sharing/ngx';
constructor(private socialSharing: SocialSharing) { }
...
// Check if sharing via email is supportedthis.socialSharing.canShareViaEmail().then(() => { // Sharing via email is possible}).catch(() => { // Sharing via email is not possible});
// Share via emailthis.socialSharing.shareViaEmail('Body', 'Subject', ['recipient@example.org']).then(() => { // Success!}).catch(() => { // Error!});