Testing your Facebook App in your LocalhostPosted: March 13, 2011
When creating an application that uses Facebook as an authentication method, a couple of things that you have to keep in mind so that you can test locally.
- Register your app at developers.facebook.com – Straight forward. This is where you’ll get your App ID, Secret ID and all them IDs.
- Change your app settings.
- Change your hosts file to reflect the change. This should point your 127.0.0.1 to localhost.local
You can find the hosts file at C:\Windows\System32\drivers\etc\hosts. Make sure you run your notepad or any editing tool as administrator to be able to make the change.
- If you’re using IIS then you should take note of the default web site. It’s more straight forward if you’re running apache (I’m using XAMPP) as you just need to put it in the correct folder.
- If you didn’t get it right you’ll get an API Error Code: 191 API Error Description.
- When you start testing your app you should view the URL http://localhost.local/ instead of localhost only
This should reflect “Site URL – http://localhost.local/” and “Site Domain – localhost.local”
Hope this helps and enjoy building your app!