Cordova应用的Facebook频道网址 [英] Facebook channel URL for Cordova app

查看:137
本文介绍了Cordova应用的Facebook频道网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个HTML5移动应用程序,使用cordova 2.6,并且我正在针对iOS,Android BlackBerry和Windows Phone。

I am working on a HTML5 mobile app, using cordova 2.6, and I am targetting iOS, Android BlackBerry and Windows Phone.

我正在尝试实现Facebook共享功能使用Facebook JavaScript SDK。
我试图在Corodova InAppBrowser内部执行此操作

I am trying to implement Facebook sharing feature using Facebook JavaScript SDK. I am trying to do it inside Corodova InAppBrowser

我的FB.init函数如下:

My FB.init function is as following:

  FB.init({
        appId      : '0000000000',
        channelUrl : './js/libs/fb/channel.html',
        status     : true
      });

我有错误:

我的Facebook应用配置有什么问题,或者我的FB.init函数?

Is there anything wrong with my Facebook app configuration, or my FB.init function?

推荐答案

如果您希望在phonegap项目中使用Facebook JS SDK方法,则需要使用 Facebook插件

If you wish to use Facebook JS SDK methods inside a phonegap project, you need to use the Facebook Plugin

当你试着做一个常规的网站,Facebook阻止你,因为你没有向他们提供授权的域名。问题是,您的JS代码在每个设备上本地运行,因此您没有这样的域,因此您不能使用Facebook JS SDK。

When you try doing it as a regular website, Facebook blocks you since you didn't provide them the authorized domain. the problem is, your JS code runs locally on each device so you don't have such a domain, and therefor you cannot use the Facebook JS SDK.

您可以避免该插件通过使用其他一些方法,如使用子浏览器插件(请参阅:此示例

you can avoid the plugin by using some other methods, like a using a childbrowser plugin (look at: this example)

祝你好运

这篇关于Cordova应用的Facebook频道网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆