Given URL is not allowed by the Application configuration. when using the Facebook Javascript SDK

狂风中的少年 提交于 2020-01-15 12:33:45

问题


Im currently using the Facebook Javascript SDK and I keep running into the following problem that appears in the console:

Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings.  It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.

I've read a truck load of related posts but still can't get it to work. I am working locally using the following: http://localhost:8080/bookbayapp/. In my facebook developers app section I have the following:

But once again nothing seems to work. I am currently using Google Chrome for the testing and it is worth to mention that I am using the Facebook Plugin for Phonegap but when testing I comment out the link the to plugin js so I assume in doing this there shouldn't be any problems?


回答1:


What works for me is using the actual URL of the production server, and then adding a line to the hosts file that redirects all traffic from that URL to localhost.

Let's say your website is called potatoes.com. In "Site URL" write:

http://potatoes.com/bookbayapp

and then open your hosts file (C:\Windows\System32\drivers\etc\hosts) and add the following line:

potatoes.com 127.0.0.1


来源:https://stackoverflow.com/questions/16933115/given-url-is-not-allowed-by-the-application-configuration-when-using-the-facebo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!