facebook graph api determine if user likes url

后端 未结 6 1321
-上瘾入骨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:58

    From the Graph API you can get the likes of a user by his id, as:

    https://graph.facebook.com/ID/CONNECTION_TYPE

    so for getting the likes you put your access token and:

    https://graph.facebook.com/me/likes?access_token=2222222222222222

    then look for your page if it is liked or not.

    However you can always try FQL queries which i didnt try for Likes actually.

    I hope that helped.

提交回复
热议问题