Social Sharing

Contents

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

联系我们?

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.

Contact Us Today!

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

ionic cordova plugin add cordova-plugin-x-socialsharing npm install @ionic-native/social-sharing
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
ionic enterprise register --key=YOURPRODUCTKEY npm install @ionic-enterprise/social-sharing

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

  • Android
  • Browser
  • iOS
  • Windows
  • Windows Phone

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

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