Connect to Facebook with Javascript Client Library using Adobe AIR

Posted by Chuck Hriczko on Stack Overflow See other posts from Stack Overflow or by Chuck Hriczko
Published on 2010-01-02T06:45:29Z Indexed on 2010/04/17 19:23 UTC
Read the original article Hit count: 229

Filed under:
|
|

I'm having an issue connecting to Facebook through the Javascript Client Library in Adobe AIR. It works fine in the browser but in Adobe AIR it seems to not be able to find the Facebook functions. Here is some code I copied from the Facebook website: (Oh and I have the xd_receiver.htm file in the correct path too)

<textarea style="width: 1000px; height: 300px;" id="_traceTextBox">
</textarea>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>

//

      var api = FB.Facebook.apiClient;
      // require user to login 
      api.requireLogin(function(exception){
          FB.FBDebug.logLevel=1;
          FB.FBDebug.dump("Current user id is " + api.get_session().uid);
          // Get friends list 

         //5-14-09: this code below is broken, correct code follows 
         //api.friends_get(null, function(result){
         //     Debug.dump(result, 'friendsResult from non-batch execution ');
         // });

           api.friends_get(new Array(), function(result, exception){
                FB.FBDebug.dump(result, 'friendsResult from non-batch execution ');
           });
      });
});
//]]>
</script>

© Stack Overflow or respective owner

Related posts about adobe

Related posts about air