views:

135

answers:

2

Facebook Connect has a recent bug that is causing the permissions pop-up window to not close and refresh the parent window as it is designed to do. Instead, after approval by the user it attempts to load the page directly in the pop-up window which is an awful user experience and really hurting our registrations. You can see the bug by registering for our site using Facebook Connect: http://alltrails.com

The URL of the page after the user connects that Facebook Connect is incorrectly loading in the permissions pop-up window is of the form:

http://alltrails.com/?installed=1&session={"session_key":"2.Gu0duOqdElNjXRac5wnetw__.3600.1283799600-1486832834","uid":1486832834,"expires":1283799600,"secret":"tKFaEgBTF9RJeuQZfYUSCw__","base_domain":"alltrails.com","sig":"a8dd9f75418b530ae6c3d935e14274c4"}

I'm hoping that someone much better at JavaScript than myself could suggest a simple code snippet that we could add to our homepage that would only be invoked if the page URL includes '?installed=1' and would do the following to allow the same user experience as Facebook Connect was intended to provide:

  1. Close the permissions pop-up window
  2. Load the appropriate page http://alltrails.com/register/facebook in the original parent window

I've tried to do this a bunch of different ways but haven't had any luck with getting it to work correctly. Thanks in advance for your help!

A: 

Same problem here as well

oyagev
A: 

It's a (unconfirmed) bug.

http://bugs.developers.facebook.net/show_bug.cgi?id=12260

Hopefully it gets more votes so it gets fixed - vote people!

In the meantime, i am (attempting) to employ the following 'creative workaround':

  1. Add logic to my Default.aspx page to detect that URL they are redirecting to in the popup.
  2. Redirect to my page, FacebookInboundAuthorization.aspx, preserving querystring.
  3. On load of that page, register some JavaScript to close the popup and manually fire the "onlogin" event handler for my button.

EDIT - Another possible solution

So i do something like this for the "Disconnect from Facebook" button, which has a similar bug which has been in FBC from day 1. If the user is already logged in, and you click the "Disconnect from Facebook" button, the "onlogin" handler is not fired.

So what i ended up doing is replacing the Facebook Disconnect button with my own regular anchor tag, mimicing the Facebook CSS. This way i can have full control over the click event (fire the function i want).

So, this principle could (theoretically) be applied to this current bug.

That is, after you do FB.Init on client-side:

  1. Check FB auth status using FB.Connect.ifUserConnected
  2. If user is connected, hide the regular FB:Login button, and show your "fake" FB Login button. Copy across the "onlogin" function from your regular FB:Login button to your fake button as the onclick event.

Your Fake FB Login button would be a regular anchor tag, with the same CSS applied to the regular FB Login buton.

So essentially, if the user is already connected, we don't really need FB's intervention for authentication, we can just do whatever we want (request perms, redirect, etc).

That should work.

Unfortunately i have higher priority things i need to work on, but it sounds like this is top priority for you.

So give that a go, hope it helps.

RPM1984
@Downvoter - The answer to this question is that "its a Facebook bug" - which i provided a link for. To me, that IS helpful, and hence shouldnt be downvoted.
RPM1984
@RPM1984 - Can you provide the JavaScript you are using in FacebookInboundAuthorization.aspx to close the pop-up and then fire the event handler in the parent window? That is essentially what I can't figure out how to do. Thanks!
Russell C.
@Russell C - unfortunately i have tried, but can't seem to get a handle on my onlogin callback function. The fact FB.init happens after the page has loaded does not make it easy. I am considering not doing the 'workaround' above, as they have confirmed the bug and are going to fix it, so any effort is basically wasted.
RPM1984
@Russel C - you're wasting your time doing a fix, as they are going to fix this issue soon anyway.
RPM1984
@RPM1984 - Here we are almost 2 weeks after the initial onset of the bug and it's an issue. According to Google Analytics I've lost a few 1,000 sign ups due to users abandoning after they hit hit the bug. For me it's something for trying to fix.
Russell C.
@Russel C - it seems to be random now, sometimes it errors, sometimes it doesnt. The thing with FB is they seem to "try and fix things", not following the change control. So although the bug is state "NEW", it might be fixed tomorrow, or never.
RPM1984
@Russel C - see my edit
RPM1984
@RPM1984 - thanks for the suggestion. I think we are going to move to Open Graph instead of going through the hassle of doing this to resolve the bug with FB Connect but your suggestion would be the solution otherwise. Thanks again!
Russell C.
@Russel C - no problems. I agree, once i get time i will be migrating to the Graph API also.
RPM1984