Help with social share


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
            .then((img) => {

                this.platform.ready().then(() => {

                    let message: string = 'Message';
                    let subject: string = 'Stats';
                    let file = img;
                    let link = '';

                    SocialSharing.share(message, subject, file, link);

            }, (err) => {

                let prompt = this.alertCtrl.create({
                    title: 'Fallo',
                    subTitle: err,
                    buttons: ['Aceptar']


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!



I solved it:

public shareStats(): void {

        this.platform.ready().then(() => {
            // Take a screenshot and get temporary file URI
                .then((res) => {

                    var options = {
                        message: this.SHARE_OPTIONS_MESSAGE,
                        subject: '', // fi. for email
                        files: [res.URI], // an array of filenames either locally or remotely
                        url: this.SHARE_OPTIONS_URL,
                        chooserTitle: this.SHARE_OPTIONS_CHOOSER_TITLE // Android only

                        .then(() => {
                        .catch((err) => {

                }, (err) => {




And please, add to the docs how to manipule the Screenshot URI Response… people can’t guess that:




Were you able to identify to where the screenshot was shared?