here i am firstly sharing a image using ionic social share for this what i did is i grabbed the image by using Canvas and and i am exporting the same image code to the share plugin. when i do that i am getting the below in my body i mean i am sending via email
'data:image/png;base64,R0lGODlhDAAMALMBAP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAUKAAEALAAAAAAMAAwAQAQZMMhJK7iY4p3nlZ8XgmNlnibXdVqolmhcRQA7'
below is my code : Home.html
<canvas #myCanvas>
<ion-card>
<img [src]="image">
<ion-card-content>
<ion-card-title>
Nine Inch Nails Live
</ion-card-title>
<p>
The most popular industrial group ever, and largely
responsible for bringing the music to a mass audience.
</p>
</ion-card-content>
</ion-card>
</canvas>
<button ion-button (click)="getDat()"></button>
.ts code
@ViewChild('myCanvas') myCanvas:ElementRef ;
image:any = 'https://images.pexels.com/photos/6966/abstract-music-rock-bw.jpg?auto=compress&cs=tinysrgb&h=350';
constructor(public navCtrl: NavController,public share:SocialSharing) {
}
getDat(){
var canvas = this.myCanvas.nativeElement;
var imageBase64Data = canvas.toDataURL("image/png");
console.log(imageBase64Data)
this.share.canShareViaEmail().then(() => {
this.share.shareViaEmail(imageBase64Data,'IDCARD', ['trend@gmail.co']).then(() => {
;
}).catch(() => {
// Error!
});
}).catch(() => {
// Sharing via email is not possible
});
}
so it possible to send image in the body