O'Reilly logo

Facebook Cookbook by Jay Goldman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making Calls (Desktop Only)

Problem

How do I make a call to the Facebook API server from my desktop app?

Solution

Generally speaking, you prepare a request and then transmit it to the API server (see http://api.facebook.com/restserver.php) using POST over the HTTP protocol. The server will return an XML response.

Discussion

You could write your own code to manage the Facebook session and handle the server communication, but you might want to leverage the excellent work other people have been doing and use one of these libraries instead:

.NET

Facebook and Microsoft have partnered to provide a Facebook Developer Kit built on Popfly and Visual Studio Express. You can get more information and downloads at http://www.microsoft.com/express/samples/facebook/. Even more information is available on CodePlex at http://www.codeplex.com/FacebookToolkit. An alternate library, Facebook.NET, which includes support for C# and VB.NET, can be found on CodePlex at http://www.codeplex.com/FacebookNET.

ActionScript

The facebook-actionscript-api is an MIT-licensed library for secure communication between Flash/Flex apps and the Facebook server, written and maintained by Jason Crist. More information and downloads are available at http://code.google.com/p/facebook-actionscript-api/.

Java

Facebook used to provide an official Java Client Library, but it has subsequently been discontinued. The facebook-java-api project has taken over with an open source version, which you can download at http://code.google.com/p/facebook-java-api/ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required