Skip navigation
Currently Being Moderated

FacebookMobile API

Nov 22, 2011 7:27 AM

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?

 
Replies
  • Currently Being Moderated
    Nov 23, 2011 4:13 AM   in reply to dmeN

    I am also facing the same issues. Any help on this would be great.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 27, 2011 12:44 PM   in reply to dmeN

    I'm having the same trouble.

     

    Is there a way to delete the old access token so that it isn't getting checked? i.e. when we recieve teh oAuthException whats the best way to handle it?

     
    |
    Mark as:
  • Currently Being Moderated
    May 21, 2012 3:09 AM   in reply to dmeN

    Same here,

     

    does anyone have a solution for this? May the FB-App was set up wrong?

    I haven't published my app in the Apple AppStore yet, so I had to use the "iPad App Store ID" from another App.

     

    Would be great if someone found a workaround to get this working.

     
    |
    Mark as:
  • Currently Being Moderated
    May 25, 2012 8:37 AM   in reply to FR Productions

    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);

         }

       

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points