My favorites | Sign in
Project Logo
                
Code license: Apache License 2.0
Labels: java, facebook
Feeds:
People details
Project owners:
  john.beatty
Project committers:
benjamin.renaud

Overview

Facebook provides a Java-based API, but I wanted a slightly different API for a few reasons:

None of these are criticisms--I find the Facebook Java API generally well coded; I just have different requirements.

Javabook Limitations

Quick Start

Here's how you can make an FQL query for a user given an auth key (e.g., one that you receive from the FB login procedure).

      String apiKey = ""; // YOUR API KEY
      String secret = ""; // YOUR SECRET

      // Just create one of these for your app/process
      FacebookRpcClient fbRpcClient = new FacebookRpcClient(apiKey, secret);

      // You just need one of these for your app, too
      FacebookClient fbClient = new FacebookClient(fbRpcClient);

      String authToken = ""; // an auth token you've received
      
      // creates a session from the auth token
      FacebookSession session = fbClient.createSessionKeyForAuthToken(authToken);
      FacebookSessionClient fbSessionClient = new FacebookSessionClientImpl(App.getServer().getFacebookRpcClient(), session);

      JSONObject obj = fbSessionClient.queryForObject("select first_name from user where uid=" + session.getUid());

      String name = obj.getString("first_name");








Hosted by Google Code