FB.Event.subscribe不适用于auth.login,auth.logout和auth.statusChange [英] FB.Event.subscribe not working for auth.login, auth.logout and auth.statusChange

查看:82
本文介绍了FB.Event.subscribe不适用于auth.login,auth.logout和auth.statusChange的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

facebook允许我使用弹出窗口登录,很好.

facebook is allowing me to login with a pop up window, which is fine.

但是我无法使用FB.Event.subscribe捕获任何事件. 我尝试订阅auth.statusChange,因为许多论坛都提到了这一点.似乎没有任何效果.

But I am not able to catch any event using FB.Event.subscribe. i tried subscribing for auth.statusChange as many forum mentioned that. nothing seems to be working.

即使这也不起作用.怎么了?

Even, this too is not working. What's wrong ?

FB.getLoginStatus(function(response) {
            console.log(response);
            });

推荐答案

终于找到了问题所在. 在facebook应用程序设置中,我的应用程序域设置为localhost(不接受127.0.0.1),而我正在以127.0.0.1的身份访问localhost,这造成了问题.

Finally found the problem. In facebook app setting, my app domain was setup as localhost (it does not accept 127.0.0.1) and I was accessing my localhost as 127.0.0.1 and that created the problem.

当我以localhost身份访问该站点时,我能够捕获所有事件. 请注意这一点.

When I started accessing the site as localhost, I was able to catch all the events. Note this point.

这篇关于FB.Event.subscribe不适用于auth.login,auth.logout和auth.statusChange的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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