for several years I have an FBML application (a small Flash game ) that I am trying to convert to an iFrame application now. Unfortunately, there are still few documents for iFrame Facebook applications.
For my game I need a username, image, gender and city.
In my old version, I had this preliminary FQL (created once by a PHP script):
$fql = array('info' => array('pattern' => 'facebook', 'query' => 'SELECT first_name, sex, pic_big, current_location FROM user WHERE uid={*user*}')); $fb->api_client->admin_setAppProperties( array('preload_fql' => json_encode($fql)));
and then my FBML script application was as simple as:
<?php require_once('facebook.php'); define('FB_API_ID', 'XXX'); define('FB_AUTH_SECRET', 'YYY'); $fb = new Facebook(FB_API_ID, FB_AUTH_SECRET); $viewer_id = $fb->require_login(); $data = json_decode($fb->fb_params['info'], true); $first_name = $data[0][0]; $last_name = $data[0][2]; $female = ($data[0][3] != 'male'); $avatar = $data[0][3]; $city = $data[0][4]['city']; # and then I'd just construct flashvars attribute # for the <fb:swf ...> tag and print it ?>
Does anyone have any tips on how to recreate the same script for the iFrame version, i.e. how can I get Preload FQL result using iFrame application ?
According to an old Facebook blog post, Preload FQL should be available for iFrame applications .
Thanks! Alex
source share