5 Replies Latest reply: May 25, 2012 8:37 AM by Ironikorn RSS

    FacebookMobile API

    dmeN Community Member

      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?

        • 1. Re: FacebookMobile API
          ajay_p Community Member

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

          • 2. Re: FacebookMobile API
            dmeN Community Member

            I think Facebook must have changed something.  The examples that come with the API don't work either - and produce the same error message.

            • 3. Re: FacebookMobile API
              donalokeefe

              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?

              • 4. Re: FacebookMobile API
                FR Productions Community Member

                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.

                • 5. Re: FacebookMobile API
                  Ironikorn Community Member

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

                       }

                     

                  }