Chris Herring

 Flash Developer

 London

Facebook API: Who and your App?

25/08/09

When creating a Facebook App with the Adobe Flash Facebook API, it’s pretty useful to know which of the users friends, has also added your Facebook App for scoreboards etc. A simple FacebookCall using GetAppUsers and then interpreting the returned data with GetAppUserData can yield an array of UID’s or raw XML. The code below needs a valid Facebook session.


private function getAppUsers():void
{
var call:FacebookCall = facebook.post(new GetAppUsers());
call.addEventListener(FacebookEvent.COMPLETE, this.callCompleteHandler);
}

private function callCompleteHandler(event:FacebookEvent):void
{
event.target.removeEventListener(FacebookEvent.COMPLETE, this.callCompleteHandler);
var appUserData:GetAppUserData = event.data as GetAppUserData;

trace(appUserData + " :: uids : " + appUserData.uids)
trace(appUserData + " :: RawResult : " + appUserData.rawResult)
}

Tags: , ,

1 Comment

 
  1. Tanja

    25/08/09

    Thanx a lot! Couldn’t found anything about this in internet. I and my friend, we’re developing Facebook MMOSG for our bachelor degree and really have no time, ur post helped us :) )))

  2.  

Post a comment