Understanding the architecture of applications built on the Facebook and Flash Platforms

Understanding the architecture of applications built on the Facebook and Flash Platforms | Developer Center

Understanding the architecture of applications built on the Facebook and Flash Platforms

The Flash Platform lets you build rich, user experiences. The Facebook Platform lets you build rich, social experiences. Put the two together, and you can build killer applications incorporating social capabilities in highly interactive, expressive, and responsive applications.

This article introduces you to the architecture of applications using the Facebook and Flash Platforms. It provides an overview of the different types of applications you can build and how the applications communicate with your server and the Facebook server.
The types of applications you can build

You can build three types of Flash Platform applications to integrate with Facebook: applications on Facebook, external website applications, and desktop applications.

* Applications on Facebook are web applications that are hosted on your own server but which users access from the Facebook website. The user sees the Facebook chrome with your application inside of it. You visit an application on Facebook (often by either responding to a friend's invitation or by following a link when searching for an application) and the Facebook server proxies the request to your server and retrieves an application page (HTML and JavaScript) to display on the Facebook website. This provides a seamless experience to users when they are on the Facebook website; users never leave the Facebook website. Examples include the Who Has the Biggest Brain application from Playfish and Zynga's Texas Hold'em Poker.
* External website applications also are hosted on your own server, but users access them through your URL, not through the Facebook website. On external websites, you can use the Facebook API or Facebook Connect to add social features from Facebook. If you use the Facebook API to log in, users will be directed to the Facebook website in a new browser window where they must log in before returning to your application. To provide a seamless login experience without requiring logging on the Facebook website, you use Facebook Connect. For example, a user may be reading a blog and may want to enter a comment. Instead of requiring that the user create yet another account for another website, let her use her Facebook account to log in. In addition to streamlining the login process, your application can now also access all of the user's data; for example, the user's name and picture can be displayed next to her name when she posts a comment. Similarly, on a shopping website, by letting the user log in with her Facebook profile, you could then check to see if any of her friends have recommended products or submitted product reviews. Live examples include RedBull Connect and City Search which let you add comments or reviews on their websites, see any of your friends' comments or reviews, and also publish your comments or reviews to your Facebook Wall and your friends' News Feed if you want.
* Desktop applications are similar to external website applications except that you deploy your Flash Platform application as an AIR application to the desktop instead of hosting it on a website. AIR desktop applications also use the Facebook Connect to provide a seamless Facebook login for the user. Examples include Seesmic for Facebook and Nomee.

One of the first steps in creating a Facebook application is registering it with the Facebook Developer application so you can get an API key and secret key for that specific application. For details, step through the Building your first Facebook application quick start tutorial.

During the registration process, you specify settings for your application; you must set whether your application is a web or desktop application and whether your application will use FBML or an iFrame.

* For applications on Facebook, you select web application and then either an iFrame or FBML application.
* For external website applications, you specify Facebook Connect information.
* For desktop applications, you specify desktop application,

Let's take a look at the architecture of typical, embedded, non-Flash iFrame and FBML Facebook applications before delving into the architecture of embedded Flash Platform based applications, external Flash Platform websites, and Flash Platform desktop applications.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License

此博客中的热门博文

咖啡加牛奶,对健康更有益

Chrome超越Firefox的20条技巧

全球电商排行榜,一网打尽