You can use the following capacitor plugin: https://ionicframework.com/docs/native/social-sharing
First install the plugin.
npm install cordova-plugin-x-socialsharing
npm install @ionic-native/social-sharing
ionic cap sync
app.module.ts
import { SocialSharing } from '@ionic-native/social-sharing/ngx';
providers: [
SocialSharing
]
your-page.page.ts
import { SocialSharing } from '@ionic-native/social-sharing/ngx';
constructor(private socialSharing: SocialSharing)
const image = 'base64-string........'
async sharedLink(image: any) {
this.socialSharing.share(null, null, image, null);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…