At some point in my application, I use an iframe. In this iframe, some Facebook stuff could be useful and for that, I use the graph API a lot.
Problem is : when someone isn’t logged in to facebook or hasn’t allowed my application yet, they are prompted to click the “connect with facebook” button. But as soon as they click it, the iframe gets destroyed and the top page is replaced with the Facebook login page. Eventually the top page is redireccted to the previous iframe URL, but the former parent page is lost forever.
Is this the intended behaviour of FB connect ?
Is there a way to avoid it or to hack around it ? (maybe using a popup instead of an iframe, but that sounds ugly (uglier than an iframe)).
I am currently using the PHP SDK
Thanks a lot
Here is a solution for opening a pop-up :
https://developers.facebook.com/docs/reference/javascript/FB.login/
By having an element that trigger the following code on click event :
it should open a pop-up with the form to login / authorize your app.
So it involves to not use the ( deprecated ) FBML alternative.
Concerning the iframe element, I doubt you’ll find a way to achieve that. The reason is that facebook’ script checks the window.top.location to be on facebook domain.