Facebook XFBML IFrame App

Posted by user329379 on Stack Overflow See other posts from Stack Overflow or by user329379
Published on 2010-04-30T01:23:03Z Indexed on 2010/04/30 1:27 UTC
Read the original article Hit count: 485

Filed under:
|
|

Hi Guys,

I started creating an application utilizing FBML but quickly realized its limits as far as external sources like javascript and so forth. I had just finished the app and now I am looking to convert it to XFBML so I can use external javascripts. I am having an issue with the login function. It allows a user to login when I goto my site but if i go to the facebook app page my button to login still appears in the frame (even though I am already logged into facebook). Upon clicking login the app fucntions as expected. My question is why do i have to click login even though I am already logged in? On the actual website it processes the app as if I am already logged in.

Below is some of my code...


$FB_APP_URL = 'http://apps.facebook.com/XXXXXX';

$facebook = new Facebook($api_key, $secret);

$facebook->api_client->setFormat('json');

$user = $facebook->get_loggedin_user();

if (!$user) {

$facebook->redirect($facebook->get_login_url($FB_APP_URL, 1));

}

if (!$facebook->in_frame()) { $facebook->redirect($FB_APP_URL, 1); }

© Stack Overflow or respective owner

Related posts about facebook

Related posts about xfbml