Facebook Application Development (friends invite, publish to wall)

The trouble with tutorials on Facebook Application development is that they go out of date so quickly. This one was written 14th Dec 2010. The Facebook developers wiki is pants too!
So here’s what I learnt the last few days.

I’m assuming you have registered your application to be on http://apps.facebook.com/developers
and have the vital application id, application secret and application key.

The canvas is where your app shows within facebook.com – choose Iframe in the “Facebook Integration” settings.
The application page will look something like this, but have values;-)

The canvas url is the directory on your server where your application is hosted.

So firstly you need your users to add your application. I do that with fbmain.php
Which requires facebook.php downloaded from the sdk area.

Then in index.php you can start coding…

The header.inc.php contains a call to the javascript sdk you may need.

and footer.inc.php just closes the body and html

If you want to add a invite friends dialogue – this was a huge pain to google!!!


Just call that as require(“invite.php”) where you want the invite to go – the sizing javascript stops those horrible scrollbars on your iframe.

If you want to publish something on their status updates…

Now you have the basic building blocks for building your facebook app. Start coding! and stick it in index.php after the yoru app code goes here comment!

Have fun and try my app

http://app.facebook.com/yourmotisdue – 28% of us forget to get our MOT done on time, so my app will send you an email reminder a month before to get it booked in!

Leave a Reply