简体   繁体   中英

Like a Facebook Wall Post - Javascript

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM