Yes, you must have an external server for Facebook. Basically what you do is you give facebook the url of your application. When someone tries to view it from facebook ( http://app.facebook.com/yourAppName/ ), he will send a request along with some special keys for verification to your application server. All your code is on your hosting server, and from there you can make facebook API / web service callbacks to get any necessary data. You can then return any UI / HTML / FBML markup to the response, and facebook will display it.
There are tons of pre-written libraries for several languages ββon Facebook. For example, Facebooker for Ruby.
Codingwithspike
source share