The simple thing of calling FB.init
(right before </body>
) and then FB.getLoginStatus(callback)
doesn't fire the callback function.
After some debugging, I think the SDK is stuck in the "loading" (i.e. FB.Auth._loadState == 'loading'
) phase and never gets to "loaded", so all callbacks are queued until the SDK has loaded.
If I force-fire the "loaded" event during debugging - with FB.Event.fire('FB.loginStatus', 'loaded')
in case you're intersted - then the callbacks are invoked correctly.
Extra details that might be relevant:
- My app is a facebook iframe app (loaded via apps.facebook.com/myapp)
- I'm using IE9. The same behavior happens in Chrome
- The app is hosted in http://localhost
What's going on? Why is the SDK never gets to loaded?
Thanks
UPDATE: Just tried it on Chrome and it worked (not sure why it didn't work before). Still doesn't work in IE