Using the Facebook Graph API from your GWT application

It might happen that you have a GWT application and you want to use the Graph API from Facebook.
As the Graph API requires an authentication with OAuth2 this task can be easily accomplished using the GWT-OAuth2 library.
To simplify things even more I build the following utility class for you:

After setting the unique ID of your facebook app in the constant FACEBOOK_CLIENT_ID, you can easily use the Graph API by calling the doGraph method.
Here is an example that posts a message on the feed of the app user by sending some data to the me/feed path:

As you notice the variables message and url need to be defined with values of your choice before. Now have fun trying other methods of the Graph API.
If you need further permissions, you have to add them as parameters to the call of withScopes inside of the doAuth method.