I'm a newbie regarding this kind of coding, and I would really appreciate your help. However, I would like to know if it's possible to make the share button return a boolean which gives true once the content has been shared.

I need it cause my website is about winning various stuff and the sharing action will give points to users.

Ps. My script is in php.

Thanks in advance, bye.

有帮助吗?

解决方案

Yes, the Facebook JavaScript API takes a callback that indicates if the post was successful:

FB.api( '/{page-id}/feed', 'POST', {
        message: 'Check out this cool link!',
        link: 'http://coollink.com'
    },
    function (response) {
        if (response && !response.error) {
            // post successful
        } else {
            // post unsuccessful
        }
    }
);

Documentation here: https://developers.facebook.com/docs/graph-api/reference/page/feed/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top