如何确保某人已成功“喜欢”我的网站当他们按下“喜欢”我的网站上的按钮? [英] How can I make sure that someone has successfully "liked" my site when they press the "like" button on my site?

查看:127
本文介绍了如何确保某人已成功“喜欢”我的网站当他们按下“喜欢”我的网站上的按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个rails 3应用程序,需要一个Facebooklike按钮,并显示点击它并完成喜好过程(登录到Facebook等)的人的个人资料图片。由于其他原因,我的应用程序需要知道 @current_user 何时成功地喜欢我的网站。例如,如果他们点击按钮,但他们没有登录到Facebook,从来不打扰登录到Facebook完成该过程,我的应用程序不应该认为他们喜欢我的网站。最简单的方法是什么?我会感谢任何帮助。

解决方案

使用FB.Event.subscribe附加到Facebook的javascript事件

  FB.Event.subscribe('edge.create',function(response){
// fire a ajax call to store that the user已经喜欢你
});

edge.create - 用户喜欢某事时触发(fb:like)



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


Hey guys, I'm 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 liking process (logging into facebook, etc). For other reasons, my app needs to know when the @current_user has successfully liked my site. For instance, if they click the button but they aren't logged in to facebook and never bother to log in to facebook to complete the process, my app should not think that they liked my site. What's the easiest way to do this? I'd appreciate any help.

解决方案

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

这篇关于如何确保某人已成功“喜欢”我的网站当他们按下“喜欢”我的网站上的按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆