Just working through an example I found and cannot seem to get a login window to appear. I keep getting an error back from facebook:
An active access token must be used to query information about the current user.
I am getting this when calling the init method like so:
FacebookMobile.init("139905189413522", loginHandler);
function loginHandler(response:Object, fail:Object):void
{
for (var s:String in fail.error){
trace("key:",s,"value:",fail.error[s]);
}
FacebookMobile.login(handleLogin, stage, [], new StageWebView());
}
I trace the error object and see that error text above, with a type of OAuthException.
Not sure why it's thinking I'm trying to get user data? Anyone have an idea?
Had a headach with that to. You can have this error from the init function, it just says that the user isn't connected to fb. So you have to call the FacebookMobile.login function.
But beware, you'll have to tell est StageWebView object in the function parameters, don't put :
FacebookMobile.login(handleLogin, stage, extendedPermissions, new StageWebView());
But create and initialize the webview before the function call :
var myWebView:StageWebView = new StageWebView();
myWebView.stage = this.stage;
myWebView.viewPort = new Rectangle(0,0,stage.stageWidth,stage.stageHeight);
FacebookMobile.login(handleLogin, stage, extendedPermissions, myWebView);
Edit :
to be clear, you have to code something like this :
FacebookMobile.init("xxxxxxxxxxx", loginHandler);
function loginHandler(response:Object, fail:Object):void
{
if(response)
{
// good the user is already connected
}
else
{
var myWebView:stageWebView = new StageWebView();
myWebView.stage = this.stage;
myWebView.viewPort = new Rectangle(0,0,stage.stageWidth,stage.stageHeight);
FacebookMobile.login(handleLogin, stage, extendedPermissions, myWebView);
}
}
North America
Europe, Middle East and Africa
Asia Pacific