Notes on Creating a Facebook Application
Posted by Jon Lee in Personal, Web Development, tags: facebook, Facebook-Application, money
I got a couple requests on creating a Facebook Application tutorial after announcing Photogenic, my first Facebook Application. However, this seems fairly redundant as Facebook themselves have already created a great step-by-step on creating a basic application. Any tutorial I write would just be replicating it.
Instead, I’d like to mention a few things that I discovered about creating Facebook apps. As easy as they’ve made it, there are still a couple things that I think are important to note.
- Use PHP5
The client platform is written with PHP5 in mind. Although there is support for PHP4 and other languages (Actionscript, .NET, Python, Perl etc.), PHP5 is where the focus is. It requires the least amount of workarounds and is fairly optimized from what I found. - Use the Resources Available
The step-by-step tutorial is a great place to start. Past that, their official documentation is useful but not very detailed. Instead, check out the user created wiki (which is still unpolished but the stuff is there) as well as the developer forum on the Developers Application. Many questions you have will have already been asked if you know what terms to search for.
Also, Facebook has their own test-console for you to try out your code so you don’t have to write any test scripts of your own. - Infinite Sessions
This little bugger got me stumped for a little while. There are certain limitations to the Facebook Platform that exist mainly for security reasons. One of them is requiring a login before performing some actions. Of course, a script that you create has no way of logging in through a browser so you need to use an existing session key that doesn’t expire (an infinite session key). After reading this tutorial on how to get your infinite session key, it’s as simple as adding this one line to your script (although nobody tells you this):$facebook->api_client->session_key = ‘your key’;
- Get a good web host
If you expect your application to gain in popularity (who doesn’t), then you’ll need a decent host. Although Facebook caches your data and images, any elaborate application will require calls to your own server. Also, you’d want a host that supports PHP5 (not many do since it’s not as tried and tested as PHP4). Reading the developer forums, it seems like many Facebook developers use mediatemple’s grid-server to host their applications. This seems like a logical choice since their grid-cluster is able to handle pretty much any amount of traffic you throw at it so there’s no worry if your application gets too popular. - Submission to the Application Directory
Before you can submit your application to the Application Directory, it must meet 2 criteria. First, it must make use of the Facebook Platform (duh) and second, it must have at least 5 users using it. This isn’t too hard if you can convince a few friends to install it. Once on the Application Directory, you can get a lot of exposure since your application becomes searchable. - Reserve Your Application Name
Application short-names are going like hotcakes. I mentioned this in my last post but if you want a good easy-to-remember URI for your application, get it fast. Since you can create many applications without developing on them, you can essentially reserve as many names as you want for free which is why they’re going so fast. - Applications CAN be Sold
Believe it or not, there is some money in Facebook apps. According to several posts I read, the going rate for an application is about 25 cents to a dollar per active user. Some of the most popular apps have millions of users (albeit not all active) which can translate to quite a profit. It’s boggling to think that a little widget on a website you don’t even own can be sold for money but it’s true.
I hope that this helps budding Facebook application developers out there (I’m one of them). And if anybody has any ideas for a Facebook app they’d like to see, I’d be glad to take on the challenge!
Popularity: 3% [?]
Entries (RSS)