Review of Facebook Application Development with Graph API Cookbook

Packt Publishing, 2011

by Shashwat Srivastava, Apeksha Singh

Review by Dan Holmes, 18-Feb-2012

What is this book about?

Starting with just a Facebook account, a PHP host, and an SSL key this book will help you begin to understand what goes into developing applications for Facebook almost right away.  It assumes no previous knowledge of Facebook, so it will start small: app setup, authentication, getting simple metrics, etc.

Be aware, that some of the basic details regarding authentication and using the Facebook SDK’s have changed.  You will need to reference the Facebook developer documentation to fill in the new details.

But, by the end of the first two chapters, you will have everything you need to build a basic Facebook application complete with getting user information, creating posts, adding friends and uploading pictures into albums.

From there, you will also learn about how to use Facebook’s Social plug-ins–if you are just wanting to add feeds, like buttons, and other information to an existing web site.  From there, you will learn about how to add meta data to your own website to register it with Facebook’s Social Graph.

By the time you get to Chapter 10, the authors build a handful of standalone applications from the ground up.  This can be very helpful, so you can see all the pieces working together. The applications may also serve as inspiration for your own new ideas.  Don’t just start here though, it really assumes you have read the previous chapters. 🙂

The final chapter prepares you to work with Facebook’s Open Graph Beta – allowing your application to interact with Facebook and user’s Timelines in new and exciting ways.

Be aware, I’m really just scratching the surface.  If you have been looking for a nice go-to reference for ways to take advantage of what Facebook offers definitely look at the Index.  I think most developers will have more than one “oooh” or “ahhh” moment.

Is this book for you?

Beyond what you can see from the index, this book provides a solid reference for any budding Facebook application developer.  For beginners and developer enthusiasts, the cookbook format will help you see practical, useful, living examples of what you can do with the Facebook SDK.  For more seasoned developers, it will provide a go-to reference when you are needing to do something new and just need a practical example to see how the pieces fit.

If you have an idea for a new facebook application and you know even a little PHP you are ready for this book.  The book does assume you have web development experience, so it won’t teach you HTML or Javascript.  But, if you are a web developer from some other language and don’t wish to write your application in PHP, you will still get what you need from the code examples and screenshots.  Many of the examples are in Facebook’s Javascript SDK with maybe a little jQuery thrown in so much of the book will apply to you directly anyway.

How long will it stay relevant?

Facebook is still a maturing platform and as such it is constantly changing their API and requirements.  Therefore, it’s difficult to predict how long ALL of these examples will remain current.

For example, the examples for authentication and setting up the API’s will need a bit of updating to actually work.  Facebook did update their authentication API’s in the past months, so many of the examples won’t work as shipped.  There is very little discussion towards using HTTPS connections in your application, but at the moment it’s mandatory for canvas applications.  Also, the examples use the getSession() method which has been replaced getAccessToken().  So, be sure to check the offical documentation.

That being said, it is a large collection of examples which still maintain a lot of relevance and usefulness.  It should provide an excellent companion to the official Facebook documentation.

Language and Accuracy

As an American reader, I would occasionally find a word that seemed a little out of place but this is rare and far between.  As a developer the actual discussions, source code and walk throughs are very clear and concise.  Each recipe tells you what you are about to learn, what you need to have, what you need to do and what you should expect.  The format makes for an easy and understandable read but is also very useful when accessed randomly as needed.

Complete Source Code, eBooks

Even in Chapter 10, when you are building complete, standalone applications you won’t find pages and pages of unannotated source code.  At most, you may get 5 or 10 lines in a row, usually just 1 or 2.  That said, Packt offers the complete, source code for all of their examples neatly organized by chapter.  So, if you are reading and want to pull back a bit and see the examples in context, you certainly can.

This is my first development e-Book, and I was a little concerned how the format would turn out.  The book is available in .pdf, mobi and epub formats…and the format worked very well, even on smaller devices.

It’s all about the SDKs

One of the good things about this book is that all of the examples are in vanilla PHP, with only the Facebook PHP-SDK, HTML, Javascript and maybe a little jQuery.  You can read them, they tell you exactly what is going on, and it’s understandable.

It isn’t about using the latest PHP and JS micro frameworks, using MVC or any of that–none of that is this book’s job.  Remember, this is PHP–a language that seems to have at least one more framework or library than it has developers who use it.  That being said, the cookbook format and the the concise examples give you the concepts you need to fold them into your own framework or micro-framework.

If you are looking for a reference that walks you through a large number of ways for your software to interact with Facebook, be sure to check out this book.  Be aware that authentication requirements have changed since those areas of the book were written.  So, if you run into issues, be sure to reference the official Facebook documentation to understand what needs to be changed.

About me and my perspective

I’m a professional PHP Application developer with 10+ years in PHP as well as other languages and environments.  I am a ZCE in PHP 5 and 5.3 and help organize a PHP User Group in the Kansas City Metro area.  While I would not call myself a Facebook developer, I had started building one Facebook application before reading this book and wish I knew about it earlier.