I’m currently developing an adobe air game (as3) which will run on iOS. I’m trying to implement facebook api (graph api for as3). But i can’t get it working or even find a solid toturial.I’ve managed to figure out how to invoke login dialog. Here goes the code:
public final class LoadingFacebook extends Sprite
{
private const APP_ID:String = "47878787754564";
private const PERMISSIONS:Array = new Array("read_friendlists","publish_stream");
private var accessToken:String = "";
private var facebookWebView:StageWebView = new StageWebView();
public function LoadingFacebook()
{
FacebookMobile.init(APP_ID, initCallBack);
}
private function initCallBack(result:Object, fail:Object):void{
if(result == null){FacebookMobile.login(onFacebookInit,this.parent.stage,PERMISSIONS,facebookWebView)}
}
private function onFacebookInit(result:Object, fail:Object):void{
if(result == null){
trace("not logged in");
}else{
trace("logged in");
}
}
}
application allways prints out (aside from my trace:”not logged in”) this error:
TypeError: Result of expression 'j' [undefined] is not an object.
at http://static.ak.fbcdn.net/rsrc.php/v2/y3/r/g8SHMmXU-df.js : 25
at http://static.ak.fbcdn.net/rsrc.php/v2/y3/r/g8SHMmXU-df.js : 25
I really dont have any idea what that means and why is it being printed out.
In addition i would like to ask if this is the right approach or i should use native Graph iOS api in air’s native extension instead, because as3 graph API is outdated and seems to behave kind of a buggy and randomly.
Check out the new Adobe Gaming SDK that include a new set of Adobe-supported libraries like and their respective documentation (Asdocs). Specially the com.adobe.ane.social Library.
This does NOT solve ALL the task you want to achieve with or through Facebook, but it’s functionality is growing. Temporarily is basically there to add post from your app including images, text, and URL’s.
Thought you might be interested.