Creating Facebook Applications
Wednesday, November 25th, 2009 | Author:

Facebook applications are what keep most of us comming back to Facebook. Whether we are addicted to FarmVille, FarmTown, Mafia Wars or any other game you my play on Facebook.  These are all Facebook applications and anyone who has knowledge of web prorgamming can take advantage of the facebook platform for their games or applications.

As you may have also noticed with a lot of Facebook games and applications there is some area to make a little money through your application. But the heart and soul of Facebook applications is that you do not have to pay to play them, you may have to play for some advanced features but to just play the game should cost nothing. If you do charge just to play your game you will most likly not have many vistors because they will just move on to a free application.

You should have three basic skills if you want to develop your own Facebook application:

  • Good skills in PHP, Rudy on Rails, Javascript, or Python
    • These have client libraries for Facebook API
  • Knowledge of Internet, SSH, MySQL and UNIX
  • Knowledge of Web Hosting and a place on the web to host your Facebook application
    • Facebook does not and will not host your application for you.

First obviously you are going to develop your application on your own web space and for the purposes of this article we are not going to include some detail on user specific Facebook Applications. So lets say that you have your Facebook application created on your web site, well now we have to get it on Facebook.

First we will goto the Facebook Developer App and Allow it to access our profile. Once we have done this we will Set Up New Application where you will name you application and agree to the Facebook Application Terms of Service. Then you will be asked some very basic information about your application:

  1. Your API Key:
    1. This key identifies your application on Facebook. It will be passes with all of your API calls.
  2. Your application secret:
    1. This is used to authenticate the requests you make and it should never be shared because it is a secret.

Next we will click the Edit Settings on our application and we will answer a few more questions:

  1. Contact Email Address
    1. I can only asume you know what to type here
  2. Callback URL
    1. The address where your application is stored on your web hosting server
  3. Canvas URL
    1. This is the address where your application will be accessed through facebook. This will normally be the application name.
  4. Can your application be added on Facebook (Yes/No)
    1. Normally here you would want to check Yes so users can put your application on their profile
  5. Click Save and Continue

So we are almost done here but next we have to make sure that are server is ready for a Facebook applications. Some hosting services will give you the Facebook but if they don’t you will have to upload the PHP client Library to your website and upload or confirm that you have MySQL installed. The next 4 steps come from the Facebook web site on what you need to do next.

  1. Go back to the Developer application, and click the example code link under your application information. You’ll see a basic PHP file, but notice that this ample code already includes your application’s API key and secret.
  2. Copy the contents of this file and paste it into a file called index.php on your server in the same directory where the Facebook client library resides.
  3. Your application is ready for testing. Go back to a browser and enter your canvas URL
  4. You should see a page containing your first 25 Facebook friends.

So that is it and a very simple demonstration, this does not really go into to much details about creating complicated facebook applications that remember your and your progress through a game.

I hope this has given you a quick insite to how easy it can be to create a Facebook Application. Stay tuned for videos in the furture on how to create a facebook application and the more complicated features of it.