Hello World

Problem

OK! I have my new Hello World application set up in the Developers app. Now what?

Solution

You have your app all ready to go, but when you go to your URL (one like http://apps.facebook.com/jays-fantastic-demo), you get a 404 error message (see Setting Up a New App for more about setting up your app). The problem is that you don’t have anything on your server for Facebook to display, so let’s put something there. Make a new blank page in your favorite text editor (see Facebook Developer Software Toolbox for a list) and stick this in it:

<p>Hello <fb:name uid="loggedinuser" firstnameonly="false" useyou="false"/>!</p>

Save the file to your http://yourdomain.com server as index.php, and then reload your new Facebook app.

Discussion

You should now have a fully functional Facebook application that only you can see. Congrats! This app can be used as a great test bed for all of your ideas as you work your way through the rest of this book.

Get Facebook Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.