Search code examples
androidcordovasharingsocial-media

Cannot share custom text on facebook with cordova socialsharing plugin on android


I am building an app, using cordova, for android and iphone. I have this function to share some text on facebook:

window.plugins.socialsharing.canShareVia('com.facebook.katana', 'msg', null, null, null,
    function () {
        window.plugins.socialsharing.shareViaFacebook("Some custom text here" + link),
        null,
        null,
        console.log('share ok'), // success callback
        function (errormsg) {
            alert(errormsg);
        }); // error callback
    },
    function () {
        console.log("NO FACEBOOK AVAILABLE");
        navigator.notification.alert('The Facebook app is not available on your device.', // message
        console.log('facebook app not installed'), // callback
        'Share', // title
        'Ok' // buttonName
        );
    });

In iphone is all working fine, i can share the text and the link on facebook thought the native app. In android, the facebook app will open but the custom text is missing, although the link do appear.

You can see the resulting post here: https://www.dropbox.com/s/bo0ughcv9w36zec/Screen_Shot.png

I have found some posts: https://developers.facebook.com/blog/post/510/ stating the custom message will be ignored, but I'm not sure this applies, besides in ios is working properly. Any help will be appreciated. Thank you.


Solution

  • It seems that Facebook does not allow, in their facebook app for android, to add custom text, we can only share a link. More info can be found here: https://developers.facebook.com/bugs/332619626816423