Hello everybody!
I want to “share user stats” in my app. First, I do a screenshot, and then I want to share it with social share plugin…
This is my code:
public shareStats(): void {
// Take a screenshot and get temporary file URI
Screenshot.URI(100)
.then((img) => {
this.platform.ready().then(() => {
let message: string = 'Message';
let subject: string = 'Stats';
let file = img;
let link = 'https://www.example.com';
SocialSharing.share(message, subject, file, link);
});
}, (err) => {
let prompt = this.alertCtrl.create({
title: 'Fallo',
subTitle: err,
buttons: ['Aceptar']
});
prompt.present();
console.log(err);
});
}
Well, Screenshot plugin appears to work fine, but i don’t know what is happening after I added the social share code into it. Because my device do not open the tipically share options windows.
In short, I need to do screen capture and share this capture on social networks. But I do not know what I’m doing wrong because I can not debug it by being a cordova plugin and running only on mobile devices.
It makes me a bit of noise what I’m sending as a parameter: let file = img;
Because I do not know what it contains or what kind of data this img is that returns me Screenshot.URI
, because I can not debug it with the mobile device.
Thank’s so much in advance!
Ivan.