How can I make sure that someone has successfully “liked” my site when they press the “like” button on my site?

前端 未结 1 922
傲寒
傲寒 2021-01-13 12:47

I am developing a rails 3 app that needs to have to a facebook "like" button and display the profile pictures of the people who have click it and complete the liki

1条回答
  •  暖寄归人
    2021-01-13 13:05

    Attach to the Facebook javascript event using FB.Event.subscribe

    FB.Event.subscribe('edge.create', function(response) {
      // fire an ajax call to store that the user has liked you
    });
    

    edge.create -- fired when the user likes something (fb:like)

    http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe

    0 讨论(0)
提交回复
热议问题