Facebook Applications – Getting started
Thursday, November 27th, 2008The existing documentation for writing Facebook applications is, while quite good for writing miss two important facts.
Firstly output goes to the “Canvas” page, and there needs to be something output there (even if you then redirect to the user to their profile page afterwards)
Secondly to get output to the “Profile Box” you need to post the FBML (FaceBook Mark-up Language) via Facebooks API to the profile box, in PHP this is done with the following code.
$facebook->api_client->profile_setFBML(NULL, $user_id, $profile, NULL, $mobile_profile, $profile_main);
Where $user_id is the Unique facebook id of the user (saved from when they login to your app)
$profile, $mobile_profile and $profile_main hold the FBML intended for the application profile box that appears on the Boxes tab on the user’s profile, the Mobile phones and the front end narrow boxes in that order.
You can, of course, use PHP and whatever database your hosting provides to display stuff in throes boxes, but be careful as not all FBML tags are supported in the profile boxes and the canvas page.





