如何确保某人已成功“喜欢”我的网站当他们按下“喜欢”我的网站上的按钮? [英] How can I make sure that someone has successfully "liked" my site when they press the "like" button on my site?
问题描述
@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屋!