2

This is really annoying. I'm using JS SDK to connect to Facebook. And yesterday I tried everything and everything worked fine. But this morning, when I clicked the login button, after I logged in to Facebook, this popup showed up and wouldn't close by itself.

https://s-static.ak.fbcdn.net/connect/xd_proxy.php?version=3#cb=f14545c19c&origin=http%3A%2F%2Flocalhost%2Ff4dcd5fdc&relation=opener&transport=postmessage&frame=f7e77d918&access_token=...&expires_in=6642&signed_request=...&base_domain=localhost

My script is (stripped down for clarity) :

FB.login(function(response) {
    alert(response.authResponse);
}, {scope: 'email,user_birthday,publish_stream'});

The script runs (it alerts the response), but still the popup won't close. Is it because of recent Facebook updates? Though it's kinda weird that yesterday it worked and now it doesn't. Not to mention my friend's project that also uses JS SDK seems to work fine.

I've tried using other app id, using channelURL, etc but still no luck. Last resort would be using PHP SDK with window.open() for popup, but I still prefer JS solution if any.

Thanks for the answers

Henson
  • 5,563
  • 12
  • 46
  • 60
  • You had any joy with this? I've started experiencing the same thing. Can't figure it out. – Chris Disley Feb 12 '12 at 21:47
  • yes, i have! i'll provide my solution below, it's not ground-breaking though! – Henson Feb 13 '12 at 07:09
  • Seeing this same problem, except transport=flash. channelURL does not work seem to work. May be related to this: http://hustoknow.blogspot.com/2011/06/deconstructing-facebooks-flash-cross.html – Fraser Harris Feb 14 '12 at 21:14

1 Answers1

2

Apparently, my friend added another line which I don't know what for, so I simply comment the unnecessary line to make it work.

  window.fbAsyncInit = function() {
    FB.init({appId: '<?php echo $this->config->item("facebook_app_id");?>', status: true, cookie: true, xfbml: true, oauth: true});
    //FB.UIServer.setLoadedNode = function (a, b){FB.UIServer._loadedNodes[a.id] = b; }
  };  

A couple days ago it worked fine though, so I guess Facebook has been updating in the background.

Henson
  • 5,563
  • 12
  • 46
  • 60
  • Aha. That line's a hack that gets around a prior issue with IE8 and the Javascript login. We also have that, so I'll comment out too and let you know how I get on. – Chris Disley Feb 13 '12 at 21:32