问题
I am trying to use facebook graph api to find out if a user has liked a particular page.This is the query I tried
https://graph.facebook.com/user_id/likes/page_id?access_token="my access token"
I tried the same kind of query to find if two users are friends but its returning empty data set even for that.
https://graph.facebook.com/user_id/frineds/user_id
How should I solve that issue?
回答1:
You can use
GET /v2.2/{user-id}/likes/{page-id}
to find out if a user likes a page. Remember that you need the user_likes
permission!
See
- https://developers.facebook.com/docs/graph-api/reference/v2.2/user/likes#readmodifiers
For seeing if a user is a friend of another user, try
GET /v2.2/{user-id-a}/friends/{user-id-b}
You need the user_friends
permission to do so.
- https://developers.facebook.com/docs/graph-api/reference/v2.2/user/friends#readmodifiers
来源:https://stackoverflow.com/questions/27309915/facebook-graph-api-if-a-user-has-liked-a-page