Testing Facebook Graph API using Localhost

Yes, you absolutely can test web apps locally that use Facebook’s Graph API. I’ve seen a number of blog posts that tell you this isn’t possible and that you need a a fully qualified domain name (FQDN) such as https://www.xyz.com. But, I’m writing this post to correct that misinformation.

It’s really very simple and I’ve been doing this for a number of years for both JavaScript and Flex apps. When you register your app at https://developer.facebook.com, under the Website field, simply enter the https://localhost/ path where your facebook app resides and test away.

 

I’d call this a best practice for testing Facebook APIs. It doesn’t require an FQDN until you are ready to deploy the final app on a production server.