2013-05-26 57 views
8

我使用PhoneGap的插件连接到Facebook 这一个:https://github.com/phonegap-build/FacebookConnect的PhoneGap连接Facebook插件设置

我感到困惑的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登录(网站网址)指向:http://本地主机/(无空间ofcourse我只加它,因为计算器不允许在它的“localhost”的链接)和我等了几分钟(超过一天)才开始工作,但仍然无法工作。

任何想法我怎么才能让它工作?

感谢在Facebook上EIT

+0

你有没有尝试这个版本,它可能允许更多的定制。 https://github.com/phonegap/phonegap-facebook-plugin – Blynn

+0

我注意到它试图发送到Facebook的url是file:// android_assets/www/[file_name_here]。我还没有解决我应用程序中的问题,但是当我更改FB.init({})代码以匹配https://github.com/phonegap-build/FacebookConnect/blob/master/example/Simple/index .html错误消失了。 –

+0

有没有解决这个问题?有相同的问题... – K2xL

回答

1
Write this code in onDeviceReady after creating your application id on facebook 


FB.init({ 
      appId: "<your appId>", 
      nativeInterface: CDV.FB 
}); 
0

您的应用程序设置 设置你的 “与Facebook登录网站”,以

http://localhost/ 
+0

但后来Facebook的登录在真实的网站将无法正常工作 –

4

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

原生Android应用程序

其他步骤:

  • 你并不需要设置“网站与Facebook登录(网址)“到http://localhost/了。如果你有一个真实的网站(有Facebook登录),那么这是放置真实网站URL的地方。
  • 确保沙盒模式中禁用
+0

嗨。谢谢我已经完成了所有这些,但它仍然没有工作。你能帮忙吗?你认为这可能是与.ProjectActivity,因为我有一个主要的index.html代替。 – Sarah