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: 4% [?]
Entries (RSS)
A lot of hosts will have PHP 5 or have a plan to get it now that PHP 4 will no longer be supported as of January 2008.
We have been running both PHP 4 and 5 in parallel since PHP 5 was brought online.
If your application does become popular where is the revenue model to make it worth it?
Making money from applications can take one of three forms (that I can think of).
1) Including ads on your application
Facebook allows iframes (not on profiles though) where you can pretty much include anything you want (Adsense, banners etc.) in addition to your application content.
2) Linking to an external site
You can link to an external site from anywhere within your application. Assuming you own the external site, there’s another possible revenue source.
3) Selling your application
As mentioned in the post, at a rate of about $0.25 to $1 per active user.
Personally, none of the 3 ways seem very viable. Making money from Facebook won’t be easy since their applications are pretty tightly regulated. If someone that comes up with a great revenue model, it probably won’t be easy to replicate its success.
Hi. You’ve got a very useful blog. Hope you make your tutorials much easier to understand for non-programmers. Although I’ll understand if its your niche.
Cheers!
Hey Jon. I just put you in my little blog magazine article posting. you’re in volume #2 with danielle. you are boba fett. check the post, you see what i mean. Laters
Great stuff man, you’re getting a shoutout in the next post!
Useful
Useful indeed!
Does my web host should be in the U.S.? (now it’s on th U.K. but all my surfers come from the U.S.)
Depends on your application. If mainly the profile is accessed then it doesn’t matter too much since Facebook caches your data but if the canvas page gets accessed a lot then it would help to have the web host local to where most of the users come from, in this case the US.
Jon, hi.
Upon researching an idea for a piece I’m writing, I stumbled across your post.
You embellished upon ways for developers to earn revenue from their Facebook apps.
Not being tech savvy myself, I was hoping you could briefly explain the different ways, keeping the layperson in mind.
If you contact me via my e.mail addy: biteforawrite@gmail.com, we could liaise further.
I would be very appreciative of any assistance given in this regard, and obviously you will be quoted where applicable. Thanks Jon, Kate.