facebook graph api determine if user likes url

后端 未结 6 1286
-上瘾入骨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 18:04

    You're safer using the Graph API since Facebook is in the process of deprecating their REST API. So to get if a user likes your page, you will need the page ID and the access token of your app.

    https://graph.facebook.com/me/likes/PAGE_ID?format=json&access_token=ACCESS_TOKEN

    • Where PAGE_ID is the page id you want to check.
    • and ACCESS_TOKEN is your apps access token.

提交回复
热议问题