Technical Details
The user ID is passed along to canvas pages as the fb_sig_canvas_user parameter. You can access it from the new version of the PHP client using:
$fb->get_canvas_user();
This parameter will not always appear. If the user has set stronger privacy settings or is redirected from a non-Facebook URL, this parameter will return null. Furthermore, if the user is logged into Facebook and enters your callback URL (for example, <!-- m --><a class="postlink" href="http://yourdomain/facebookapp">http://yourdomain/facebookapp) directly into the browser's address bar, neither the fb_sig_canvas_user nor the fb_sig_friends parameters get POSTed in the request because this is essentially the same as being redirected from a non-Facebook site.
To access the user's friends in an iFrame application, using PHP, you can simply call friends_get( array( "uid" => fb_sig_canvas_user ) ). Or, for an FBML-based application, the friends are sent automatically, in the fb_sig_friends parameter. Either way, client libraries can get the friend ID information by making this call:
$fb->api_client->friends_get();
To access profile pictures and names, you can use FBML or use the users.getInfo method, which will return the profile picture and user name available on the user's public profile.
well a couple of things:
1) you need to add xmlns:fb="http://www.facebook.com/2008/fbml" to html tag for connect
2) if you are using connect from inside the iframe on facebook canvas - you don't need to use a "connect" button,
since the auth logic is a bit different, you can use just a regular button and require session.
there maybe more things but I didn't investigate it further
function init()
{
if (array_key_exists('fb_sig_in_iframe', $_REQUEST)) {
// Site loaded through iframe canvas
require_once (JPATH_ROOT.DS.'components'.DS.'com_jfbconnect'.DS.'controller.php');
self::addNamespace();
self::initFbApi();
JFBConnectController::loginFacebookUser();
} else {
// Site loaded through FB Connect
self::addNamespace();
self::initFbApi();
}
}
Join our newsletter to get alerts for Joomla releases, tips and tricks and extension updates.