Search code examples
facebook-graph-apifacebook-opengraph

Facebook Open Graph in development environments


We're developing a web application using Facebook Graph API. Naturally, we have a Facebook application, which I'll call "MyApp" for the sake of this question.

In order that our developers will be able to run and debug the server locally, we have a always-sandboxed Facebook application, which I'll call "MyAppDev". The domain for this application is localhost:8080. This makes it possible to do Facebook authentication on the development machines. This way, we have a different set of auth tokens for development and production, we have short dev cycles, and everyone's happy.

But when it comes to Open Graph, things get a bit tricker. That's because Open Graph objects must be backed by real URLs that are to be accessed by Facebook. Therefore, we can't really define objects and actions on MyAppDev (if we use production URLs in MyAppDev it will be inconsistent with the databases in the developers machines). So it seems that the only option is for developers to collectively use a test server for development, with a third app, lets call it MyAppTest. But this has a few downsides:

  1. This breaks the model of developers being able to run things from their own environment. I suspect it will cause slower development cycles.
  2. There's no automatic way to synchronize Open Graph configurations (at least not that I've aware of) so we'll need to manually copy the configuration (e.g., actions/objects) from MyAppTest to MyApp. This is quite error prone.

So my question is, what is the common practice for development and testing of open graph applications? Is it anything like I described? Is there a better way?

Thanks in advance,
Yaniv


Solution

  • There's no automatic way to synchronize Open Graph configurations (at least not that I've aware of) so we'll need to manually copy the configuration (e.g., actions/objects) from MyAppTest to MyApp. This is quite error prone.

    Yeah, this really is a p.i.t.a. – I wish Facebook came up with a better way of doing this; at least a “synchronize” feature would be nice.

    As for testing OG objects – only possible solution for testing that from a developer’s own machine that I can see, is to make that machine reachable from the internet; using a DynDNS service of some sort or something similar.