像Facebook墙贴 - Javascript [英] Like a Facebook Wall Post - Javascript
问题描述
我正在开发一个可以检索特定的Facebook墙贴的Facebook应用程序。我只想让用户使用javascript sdk从我的应用程序中喜欢这个帖子。任何人都知道如何完成这个工作?
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?
推荐答案
更新:
发出 POST
请求喜欢 c连接 post object 是你需要的:
UPDATE:
Issuing a POST
request to the likes
connection of the post object is all you need:
你可以通过向
POST_ID /喜欢
与publish_stream
权限的连接发出HTTP POST请求。不需要
参数。
You can like a Post by issuing a HTTP POST request to the
POST_ID/likes
connection with thepublish_stream
permission. No parameters necessary.
示例:
FB.api("/POST_ID/likes", 'post',function(response) {
if(response === true) {
alert("done!");
}
});
上述请求应在成功时返回 true
。
The above request should return true
on success.
这篇关于像Facebook墙贴 - Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!