I\'ve been writing a game for Facebook using Rails and jQuery. Since I started using the Facebook Javascript SDK, using localhost as an app domain seemed to work just fine.
The protocol seems to keep changing, and the accepted answer didn't work for me today. In case it helps other searchers, this is what did work for me:
1.) In the center under the first box of options, click "+ Add Platform" and choose "Website" (or whatever is appropriate for your app.)
2.) In the box that comes up for the website you just added: Site URL: http://localhost:3000/
3.) In the box above that (Settings => Basic): App Domain: localhost
4.) At the bottom right - click "Save Changes"
5.) Make sure you have the app ID copied and pasted correctly into your code. (The ID is in the first box on that page if you need it again.)
For everybody who is fidgeting with this in 2017. The interface changed again. I wanted to comment this to the answer but I don't have enough reputation. The localhost url of your app now has to be copied to three places. Currently, (October 26th, 2017) the sequence is:
1.) Click "Settings" in the left menu.
2.) In the center under the first box of options, click "+ Add Platform" and choose "Website" (or whatever is appropriate for your app.)
3.) In the box that comes up for the website you just added copy your localhost site url (f.e. http://localhost:3000/)
4.) In the box above that "App Domain" copy the same URL
5.) At the bottom right - click "Save Changes"
6.) In the left menu under "Products" click "Facebook Login" (or add it via "+ Add Products" if it is not available)
7.) You are now in the Facebook Login settings. Copy the same url to the field "Valid OAuth redirect URIs"
This should work.
Just add localhost as your canvas url or mobile site url, this will allow you to have both localhost and herokuapp.com in your App Domain setting. Then once your app is in production, just remove it.
to do local testing all you have to do is turn off the app, or put the facebook app in development mode. Then Facebook will allow you alone to access the app
Just a note for some others who may be struggling with this as I was. I have not been able to get this to work with "test" apps. Using my actual app settings (and simply adding
"http://localhost:3000/"
to my canvas URL) worked as everyone else suggested. It seems test apps aren't equal to actual apps.
This is wrong way. You must create a test application using Test tab in app settings. And then you can enter your development stage url (for example localhost) to your application.