facebook graph api determine if user likes url

后端 未结 6 1306
-上瘾入骨i
-上瘾入骨i 2021-02-09 17:20

I want to display a different message if a user is currently logged in to facebook and likes the current page. I understand:

FB.Event.subscribe(\'edge.create\'         


        
6条回答
  •  鱼传尺愫
    2021-02-09 17:52

    https://graph.facebook.com/{FB_USER_ID}?fields=likes.target_id(167584559969748)&access_token={VALID_ACCESS_TOKEN}
    

    shows data if that user has liked that Facebook fan page.

    or

    https://graph.facebook.com/{FB_USER_ID}?fields=likes.fields(link)
    

    shows a list of liked links, from where you can get the link you are looking for.

    All of these need 'user_likes' and/or friend_likes permissions.

提交回复
热议问题