The last couple of weeks have allowed me to get intimate with AS3 implementations of the main social network’s APIs. I first started out playing with Adobe’s Flash Platform Social Services which is basically a layer providing access to Gigya (which in turn is an abstract API providing uniform access to all of the main social networks). As you can probably imagine, this also comes with a couple of drawbacks.
- Gigya aims to provide the ‘make one call, push to many’ approach. This is one of the reasons that the full spectrum of services for one social network aren’t available, largely because there won’t be a uniform equivilant on another network.
- The other reason, is that we’re relying on a single API vendor (Gigya) to update as and when every other API vendor updates. So where a great new service might be made available on Facebook, you’ll likely be waiting a while until Gigya provides an updated interface.
Not great. So putting aside a greed to support every social network under the sun, I swiftly moved to and focused on the the most popular (and arguably the best), the Facebook Actionscript API. This is basically an Adobe supported AS3 interface to Facebook’s REST API. The majority of it is very straight forward to use, and is up to date with the latest of Facebook’s features. The biggest pain, though, has been offering a smooth login experience.
// Create a WebSession passing in your API key, the secret key and session key
webSession = new WebSession( apiKey, secret, sessionKey );
// Force set the uid (don't forget to import the "facebook_internal" namespace)
webSession.facebook_internal::_uid = uid;
facebook.startSession( webSession );
This solution will use those nice AJAX-populated dialogue boxes, so don’t forget to set wmode=”transparent” on your embed.