Like a Facebook Wall Post - Javascript

笑着哭i 提交于 2019-12-18 04:26:07

问题


I'm developing a Facebook application that 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?


回答1:


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.



来源:https://stackoverflow.com/questions/4801764/like-a-facebook-wall-post-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!