Home » Blog

 
 

January 15, 2009

Back to the OpenSocial API: Porting from Facebook to MySpace

Categories: Development, Facebook, Javascript, MySpace, OpenSocial — admin at 11:39 pm

It’s been a couple of weeks since I was last in the Google’s OpenSocial API. We are in the process of porting yet another Facebook application to MySpace using OpenSocial. Fortunately we wrote the original FB App with portability in mind.

Opensocial_fb

Facebook vs. OpenSocial
The Facebook API and OpenSocial API use very different models making reuse very difficult. At its core, Facebook uses a Server-side proxied web application model. The Facebook server talks to your PHP-based application (which uses XML-REST API to get info from Facebook) and displays the results. OpenSocial uses a Client-Side Javascript widget model where applications are written in Javascript and get information via a Javascript API. Any external communication is done using an AJAX-like API function but all the logic is on the client-side.  As a result, the development models are very different for both!

Here are a couple of suggestions to make your Facebook applications more “portable”:

  • Do not use the Facebook datastore, store preferences and application data in your own database
  • Decouple “data” pages (pages used to generate data) from your Facebook application and access the data using includes or AJAX calls, make sure your “date” pages are stand alone and do not generate any FBML.
  • Design your Facebook application to retrieve all data/information using AJAX.  This take my previous point to its logical limit but since OpenSocial users Javascript/AJAX for all of its data retrieval you’ll be in great shape.
  • Organize your libraries to separate Facebook related functions

Sphere: Related Content

July 1, 2008

Facebook API and Adobe Flash: Marriage Not Made in Heaven

Categories: Development, Facebook, Flash, Javascript, Social Media — admin at 8:48 am

We do widget, and as anyone who creates or user widgets knows Adobe Flash-based widget have dominated the social networking and media landscape for many years. With the advent (and growing popularity) of the Facebook Platform, many thought that Flash-based widget would quickly and easily make their way, unfettered, unto Facebook pages, but this has not been the case!
Facebook-flash
Flash does work on Facebook, but with some limitations. For companies and developers looking to port their Flash-ware to Facebook, here are some important considerations to be aware of:

  • Facebook does not support Flash to Javascript communication
    • Interaction between Javascript or FBSJ and Flash is prohibited. You’ll have to use flashvars to pass information into your Flash component.
  • Facebook does not support Flash links/navigation
    • In more technical terms, navigateToUrl and getURL by default do not work in Facebook (See work around)
    • You have to embed your Flash in an IFRAME in order to enable navigation to work.
  • Facebook and Flash have a problem sharing the same session
    • In less technical terms, writing Facebook/Flash applications that recognize a user’s unique activity require some hard work (and experience).
  • Flash cannot automatically begin playing on a user’s Facebook profile page
    • Flash components cannot automatically begin playing on profile pages, so the fb:swf tag displays a developer-specified place-holder image until the user interacts with the object.

Sphere: Related Content