Social Sharing

Contents

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

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

Ionic 本地分享 Social Sharing插件的安装(Installation)

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

Ionic 本地分享 Social Sharing插件支持的平台(Supported Platforms)

  • Android
  • Browser
  • iOS
  • Windows
  • Windows Phone

Ionic 本地分享 Social Sharing插件的用法(Usage)

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

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', ['[email protected]']).then(() => {
  // Success!
}).catch(() => {
  // Error!
});