The technology that powers the authentication for the Facebook APIs in an AIR-based application is a little different to its equivalent Flash Player-based web application.
As we mentioned in the introduction, the Web version of the Facebook ActionScript 3 SDK relies on the underlying JavaScript SDK. The Desktop version however doesn't have the same luxury—everything that it has to do, such as launching pop-up windows or maintaining user sessions, must be done through ActionScript 3 and the enhanced capabilities of the AIR runtime alone. Fortunately for us however, this functionality has already been built into the Facebook ActionScript 3 SDK.
The methods that we use to work with the Facebook are much the same in the Desktop SDK as those of the web-based SDK, but there are a few important variations in the parameters you pass that means it's not just a case of swapping the root class of Facebook for FacebookDesktop.
In this recipe we...