FB.getLoginStatus不调用其回调 [英] FB.getLoginStatus not calling its callback
问题描述
- FB.Auth._loadState被卡在加载 - 无论是应该如何点击加载不发生
- 稍微延迟,像放置
alert()
调用往往使它开始工作
任何提示甚至可以调查这个欢迎。
当我在与Facebook注册的不同域名下运行页面时,通常会发生这种情况。通常情况下,我正在本地开发。
如果您在本地运行,则必须设置本地Web服务器,然后修改主机文件,以指出注册域为127.0.0.1,以便在本地机器上进行测试。当您要在服务器上测试时,请勿忘记从主机文件中删除该行。
The title really says it all. Under some (undetermined) conditions FB.getLoginStatus() just stops working and won't invoke the callback I gave it. The only interesting clues I've found are
- FB.Auth._loadState is stuck on "loading" -- whatever is supposed to make it click over to "loaded" isn't happening
- slight delays like putting in
alert()
calls tend to make it start working
Any hints at all about even how to investigate this welcome.
This usually happens for me when I am running the page under a different domain from what has been registered in Facebook. Typically this is when I am developing locally.
If you are running locally, you'll have to set up a local web server and then modify your hosts file to point the the registered domain to 127.0.0.1 in order to test on your local machine. Don forget to remove that line from the hosts file when you want to test it on the server.
这篇关于FB.getLoginStatus不调用其回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!