sapnagroup has successfully implemented registration and login on www.thanksto.com using Facebook API. This was our first ever development on Facebook API and as always, we have done it with a BANG!.
Facebook API does not allow it’s code to open in same browser (cross-domain security restrictions). It has it’s own set of functions which make it mandatory to open a new window (window.open) to perform any Facebook task including the login screen. As always, (before saying no, we can’t do it!) we knocked Google doors for help and tips, but all we got is: “This is not possible.”, “ONLY option is open in new window”, etc.
And then the sleepless nights! “Why can’t it be done?”, “There should be some way out!”. Somehow our mind was not satisfied with the answer “can’t do it.” Tried opening an IFRAME and called Facebook screen via CURL. Result was “FAILURE”.
Finally we thought of tracing each and every line of Facebook API php code. Withing few minutes, we managed to crack it and now we have Facebook connect screen in the same window in an IFRAME. Something which no one has done till date.
We got couple of responses and requests asking how we managed to do it.
———————————————————————–
Subject: Facebook Connect Login PHP
Hello,
I am implementing Facebook Connect for my companies website, and came across http://www.facebook.com/l/;thanksto.com. This is by far the best login box I’ve seen for the Connect stuff.
I am interested in how you managed to get the login to cleanly populate the iframe – would it be possible for you to send me the contents of fbconnect.php? I am using the Java API, and I suspect they are slightly different.
Or even an email about it would be wonderful,
My email is “xxxxxxxxx@gmail.com”.
Cheers!
Ian
———————————————————————–
———————————————————————–
elliott3232 from Facebook Platform Developer Forum has sent you a message.
Hi Shiv,
You got the inline/iframe facebook connect dialog to work correctly. I checked out your site but could not figure out the magic. If you get the time, would you be so kind as to give a little more detail?
Thank you,
David
———————————————————————–
———————————————————————–
muhaha from Facebook Platform Developer Forum has sent you a message.
Hey shiv,
I got kind of the same problem, writing an iphone webapp and i need something like that, otherwise everytime a user wants to connect he will get redirected to another site – thats a bit wiered when you saved the webapp on your iPhone Homescreen….
So would you mind if I´m asking for your example code??
Cheers and thanks a lot
———————————————————————–
“Try it hard even if someone says IT’S NOT POSSIBLE till you are convinced yourself!! Never give up!!!”