8

我正在使用 phonegap 插件连接到 facebook 这个:https ://github.com/phonegap-build/FacebookConnect

我对 Facebook 应用程序设置感到困惑,当我调用 FB.init() 时,我收到以下错误消息:

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. 

我使用 Facebook 登录(站点 url)将网站编辑为:http://localhost/(没有空格我只添加了它,因为 stackoverflow 不允许其中包含“localhost”的链接),我等了几分钟(更多超过一天)让它工作,但它仍然没有工作。

知道如何让它工作吗?

谢谢

4

3 回答 3

4

您需要设置几个设置。
这些设置适用于 Phonegap Build 环境。

原生 Android 应用下:

其他步骤:

  • 您不再需要将“使用 Facebook 登录的网站(网站网址)”设置为http://localhost/。如果您有一个真实的网站(使用 facebook 登录),那么这就是放置真实网站 URL 的地方。
  • 确保沙盒模式被禁用
于 2013-09-29T09:11:00.000 回答
1
 Write this code in onDeviceReady after creating your application id on facebook


 FB.init({
            appId: "<your appId>",
            nativeInterface: CDV.FB
 });
于 2013-06-24T06:48:59.820 回答
0

在 facebook 上,您的应用设置将“使用 Facebook 登录的网站”设置为

http://localhost/
于 2013-08-20T23:54:59.607 回答