Facebook Graph API v2: What's Changed and What it Means


On May 1st, Facebook made a sweeping change to their programming interface. While there are many positives in this update, like longer-term stability, there were many surprises and changes that will affect your Joomla websites. If you're using JFBConnect for Joomla social network integration, you don't need to know the low-level details, but you should be aware of the bigger picture of how each change may impact you. We've broken them down into the standard good, bad, and ugly categories below to make things easier to digest.

Background on Facebook's API

To get a full picture of the changes, the below section is a quick history of the Facebook API. Feel free to skip if you're not interested in a little more of what we deal with on a day to day basis to bring you the best social network integration for Joomla.

At SourceCoast, we've been creating products around Facebook's API (Application Programming Interface) since 2008. Back then, there wasn't much of a coherent interface. It was simply a few minor things you could call and, if you were lucky, and they worked as documented, they would work.

The Early Days: 2008 Until Around 2012

At first, when you had code that worked fine for months, one day, it would just stop working for no discernible reason. Things like requesting a user's "identifier" previously may have returned their email address but then would start returning their numeric ID. I'm sure inside FB HQ there were obvious reasons for these changes, but on the outside, they were maddening as there was no warning and (many times) were not documented until after the fact.

In 2011 or 2012, Facebook added 'Migration' settings to all Applications. These migrations were a 90-day notice to all developers that a feature would change in the future. With a simple setting, you could toggle your app to use the 'old way' or the 'new way'. This allowed for a decent transition path from old functionality to new and stabilized the interface greatly. Flowers bloomed, birds sang, life was good.

The Recent Past: 2012 through April 2014

Migrations were great at first, but quickly became tedious to manage. There may be 10 different migration settings with obscure names and little details. For software like JFBConnect, we built our Autotune (automatic configuration tool) to manage migrations for our users. Since our Joomla extension works on thousands of websites and Facebook Applications, we needed to make sure our users were using the proper migration settings for their Application and their version of JFBConnect. Instead of having some massive table in our documentation of JFBConnect versions and the correct migration settings for that version, our tool automatically set them for you. That ensured they were correct and meant our users didn't need to understand all the different settings and options.

At this point, Facebook's stated policy was that there was a 90-day breaking change rule. Nothing would change or break without 90-days notice. While great on paper, things rarely ever worked that way. Facebook is changing constantly, which is frankly a good thing. When they thought something was important enough, they simply implemented the change and said 'tough luck, we'll fix that later'. Generally, no fix was ever implemented and the 'new' functionality was here to stay.

Today and Beyond: Graph API V2

The amount of migrations dwindled over time and the API, more or less, reverted to the old west. While things were pretty darn stable, some strange things (like the most maddening change which prevented responsive comments boxes) were thrown in for no discernible reason other than to frustrate. In the responsive comments box case it took more than 2 months to fix it!

On May 1st, at F8 (the Facebook Developer Conference), Facebook introduced the Facebook Graph API v2. Everything we'd used in JFBConnect for Joomla social network integration was immediately called Graph API v1, and anything new was called Graph API v2. This changes promises greater stability, but comes with quite a few gotcha's and hiccups along the way.

Facebook's Graph API v2 & Joomla Integration

Below is a run down of the main high-level changes, categorized how we see fit :)

The Good

  1. Graph API v2 will be 'stable' for 2 years. New features will be added, but a function/feature that worked yesterday should work tomorrow the exact same way it did yesterday. If followed, this is excellent news. With our software, we can target v2 of the API and have 2 years of no (or very little) change.

The Bad

  1. User's can selectively disable more permissions. Until now, when you requested additional permissions from the user (email, hometown, interests, etc), they would all show up to the user in one prompt. The user would have to accept all to be able to use your Application. Now, the user will be able to click a link that says "Select which permissions to use" and can de-select things like sharing their email with your site.
    • JFBConnect already supports this change and, if a user dis-allows their email from being shared, will send the user through the mini form-based registration. 
  2. Friends of the user is strictly limited. Previously, the authentication prompt would grant access to the user's friend list as well. Now, you need an additonal permission to get the user's friend. Additionally, only friends of the user that also use your application will be returned, which will severly limit the amount of information you'll be able to get back.
  3. Events can no longer be created through the API. JFBConnect hasn't supported Facebook Events, but it's been something we were working on. We're still planning to let you show an event's details on your site. Having an easy interface to create and manage an event in Facebook is something we were hoping to do as well.
  4. Anonymous logins are coming. The details are still pretty vague, but it seems like the ability for a user to login to your site without providing any information will be an option in the future. While some sites may welcome this, we know that most our customers using Joomla would not welcome this as it makes managing users much more tricky.

The Ugly

  1. Extended permissions need approval from Facebook. This is likely the most onerous change on application owners. If your application requests more than basic_profile, email and friends_list, each additional permission must be submitted to Facebook for review with a reason for approval. That means that if your app is asking for the user's hometown or music interests, you need to explain to Facebook why you want that information, even though the user has the ability to deny that permission at authentication anyways.
  2. The transition to v2 is bumpy. The Graph API v2 will be stable for 2 years and Graph API v1 will work for one more year until all apps are required to use v2. However, if your Facebook Application was created after May 1st, your app cannot make any v1 calls. This is particularly tricky for JFBConnect: we want our long-time users to be able to transition to v2 at their pace but we must support v2 for all new users. We've already done this using a little bit of a compatibility layer. We're hoping when Facebook announces Graph API v3 there is an announcement well ahead of time and a much broader cutoff date for 'new apps' that will only use v3.
  3. Joomla 1.5 functionality is gone, or will be soon. Until earlier this year, we still made JFBConnect v4.3.4 available to subscribers. Even though that release came out in December of 2012, it still worked without issue in Joomla 1.5. Unfortunately, the Graph API v2 breaks our Joomla 1.5 version, and we do not plan any further updates.
    • If you are already using JFBConnect v4.3.x on Joomla 1.5, with an app created before May 1st, 2014, it should continue to work until the Graph API v2 is required, in May 2015.
    • If you need to create a new Facebook Application, JFBConnect v4.3.4 will not work as it does not support Graph API v2. In that case, it's about time to upgrade to Joomla 2.5 or 3.x.

The Lucky

You! (if you're using JFBConnect). We work hard to stay on top of the changes in each social network. That's why we sent out email notifications about a smaller, but still largely breaking, change in LinkedIn's API in late April to require an OAuth2 callback URL be provided. While the above may be hideously boring, the good news is that you didn't have to read through tons of documentation, comments and bug reports to learn it all. That's our job, and we'll make this transition, just like every other update, as smooth as possible over the coming year.

As always, we'd love your questions, feedback or comments on the changes in the Graph API or the integration with your Joomla site and how it may affect you. We'll here to help however we can!

Alex Andreae

Alex co-founded SourceCoast Web Development in 2008. Based in sunny Florida, SourceCoast develops extensions for integrating your Joomla powered website with popular social networks. He has spoken at more than a dozen Joomla User Groups and Joomla Days, including the Joomla World Conference in both 2012 and 2013. Topics have included social networking for Joomla, running a business around Joomla extensions, and Joomla development.

Find Alex around the web: