开发者

Like a Facebook Wall Post - Javascript

开发者 https://www.devze.com 2023-02-06 14:34 出处:网络
I\'m developing a Facebook application th开发者_如何学Goat retrieves specific facebook wall posts. I simply want to allow the user to \"like\" the post from within my application using the javascript

I'm developing a Facebook application th开发者_如何学Goat retrieves specific facebook wall posts. I simply want to allow the user to "like" the post from within my application using the javascript sdk. Anyone know how to accomplish this?


UPDATE:
Issuing a POST request to the likes connection of the post object is all you need:

You can like a Post by issuing a HTTP POST request to the POST_ID/likes connection with the publish_stream permission. No parameters necessary.

Example:

FB.api("/POST_ID/likes", 'post',function(response) {
    if(response === true) {
        alert("done!");
    }
});

The above request should return true on success.

0

精彩评论

暂无评论...
验证码 换一张
取 消