Facebook App: localhost no longer works as app domain

后端 未结 13 1127
我寻月下人不归
我寻月下人不归 2020-11-28 02:33

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.

相关标签:
13条回答
  • 2020-11-28 02:47

    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:

    • All changes were made on the Settings page under the Basic tab

    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.)

    0 讨论(0)
  • 2020-11-28 02:54

    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.

    0 讨论(0)
  • 2020-11-28 02:54

    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.

    0 讨论(0)
  • 2020-11-28 02:54

    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

    0 讨论(0)
  • 2020-11-28 02:59

    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.

    0 讨论(0)
  • 2020-11-28 03:01

    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.

    0 讨论(0)
提交回复
热议问题