HOW-TO: Get Your Facebook Application to Show Up on a Page's Wall and Boxes Tab – January 29, 2010

It about to be deprecated, so this information won't be worth much in a month or two, but for some reason, the documentation on how to post stuff to a page's wall is really sparse, and took me a while to figure out, so here goes, and I'll try to add in the keywords that I searched for while trying to find the answer.

The problem: I have an application that can successfully post to a user's wall, boxes and separate tab (If you haven't gotten that far, you have other issues, probably related to using an old API, or not filling in the setFBML parameters appropriately), but the application will only post to a fan page's tab, and not the wall or boxes tab.

The solution has a couple parts:

1. You need to call setFBML on behalf of the page.  Your normal code probably uses $facebook->get_loggedin_user() (I'll use PHP API examples) to grab the user id and then call setFBML with that as the $user parameter.  However, that doesn't work for a page, since you need to use the page ID - and posting to a tab doesn't uset setFBML you might not realize that your canvas page code isn't being called at all for your page, only for your profile!

Now, the trick is, how to get the page id?  It comes to your canvas page when you click on "edit" from the "edit page" link.  That link goes to your canvas page, but with an extra parameter attached so your code should look for $_POST["fb_sig_page_id"] and if that is set, use that, rather than the get_loggedin_user() call for the setFBML() call.

Facebook doesn't seem to like people to post to a page's wall directly, so they make you post to the boxes tab first (and if you have a new page, it might not have a boxes tab, so you can try hunting for it by clicking on the '+'to the right of the tabs, though I've heard of people who couldn't find it and had to do various tricks to get it to show up (like installing the "links" application, posting a link, and then finding the boxes tab and then deleting the link...), but once you can see your FBML box on the boxes tab, then you click on the pencil icon and choose "move to wall".  Tada.  Wasn't that hard, but took me an hour or two of searching the docs and random forums to finally find it and figure it all out.

Now - once the boxes tab and wall boxes go away, then you'll only be able to publish to the individual tabs anyway, but until they get rid of this useful feature and ruin all the apps I've ever written or cared about, perhaps these instructions will get you on your way.

If you are still lost, Lime Daley has written a number of Facebook applications and would be happy to help you out with your app too.