简体   繁体   中英

Facebook Graph API check likes

How do I check if the authenticated user has liked a particular post?

I am not using the Facebook SDK.

Thanks!

You can use Facebook Graph API , there is fields likes , so it will get all likes data of the specific post. Then, you can check whether your friend id in the likes data. 在此处输入图片说明

With a post has lot of likes, you can use limit parameter like this.

/{post_id}?fields=likes.limit(5000)

The likes data supports paging, so you might fetch all likes of the post.

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