Phonegap Facebook连接插件设置

时间:2013-05-26 12:12:36

标签: javascript facebook facebook-javascript-sdk cordova

我正在使用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登录(网站网址)编辑了网站:http:// localhost /(没有空间,我只添加了它,因为stackoverflow不允许带有'localhost'的链接)我等了好几个分钟(超过一天)让它工作但它仍然无效。

任何想法我怎样才能让它发挥作用?

感谢

3 个答案:

答案 0 :(得分:4)

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

原生Android应用下:

其他步骤:

  • 您不需要将“使用Facebook登录网站(网站网址)”设置为http://localhost/了。如果您有一个真实的网站(使用Facebook登录),那么这就是放置真实网站URL的地方。
  • 确保禁用沙盒模式

答案 1 :(得分:1)

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


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

答案 2 :(得分:0)

在facebook上

执行您的应用设置 将您的“使用Facebook登录的网站”设置为

http://localhost/
相关问题