Facebook JS SDK可以与Phonegap / Cordova一起使用吗? [英] Can Facebook JS SDK work with Phonegap / Cordova?
问题描述
我知道有类似的问题,但也许我只是不够智能:)
I know there were similar questions, but maybe I'm just not intelligent enough:)
我有Senscha 2.0手机应用程序,我想使用最新的phonegap (cordova)。
I have Senscha 2.0 mobile application which I want to build using latest phonegap (cordova).
我要在其中添加Facebook登录功能...我发现有三个选项:
I want to add facebook login functionality there... I found out that there are three options:
- 使用ChildBrowser方法
- 使用InAppBrowser。
- 使用cordova Facebook插件
我鄙视了第二个。
但是我在FB应用程序设置(移动网站URL)有问题
我键入其中一个矿区域,但是当在xCode中使用Cordova构建应用程序时,facebook回应一个错误,因为显然phonegap / cordova不使用任何域名。
当我将应用程序(不使用phonegap)上传到我在Facebook设置中输入的域时,一切在我的iPhone上使用(使用Safari中的网站)。
I decdied to go with the second one. However I have problem with domain in FB app settings (Mobile Site URL) I typed one of mine domains there, but when building app using Cordova in xCode, facebook response with an error, because obviously phonegap / cordova doesn't "use" any domain. When I uploaded my app (without using phonegap) to domain which I typed in Facebook settings, everything works great on my iPhone (using as website in Safari).
EDIT:
更精确。
当我将我的应用程序用作移动Web应用程序时,Facebook JS SDK适用于我。
当我使用Cordova / Phonegap构建我的项目(它自动使用InAppBrowser插件),它停止工作。
To be more precise. Facebook JS SDK works for me when I'm using my application as "mobile web application". When I build my project using Cordova / Phonegap (it automatically uses InAppBrowser plugin), it stops working.
我的问题是:
JS SDK与Phonegap / Cordova合作?
My question is: Will Facebook JS SDK work with Phonegap / Cordova?
我为我的英语沮丧道歉。
我希望你们能理解我。
I apologize for my crappy English. I hope you guys can understand me.
推荐答案
可以。使用OpenFB或Facebook Connect Phonegap插件。
It can. Use OpenFB or Facebook Connect Phonegap Plugin.
参考
OpenFb
- http: //coenraets.org/blog/2014/04/facebook-phonegap-cordova-without-plugin/
- https://github.com/ccoenraets/OpenFB
- http://coenraets.org/blog/2014/04/facebook-phonegap-cordova-without-plugin/
- https://github.com/ccoenraets/OpenFB
Facebook Connect Phonegap插件
Facebook Connect Phonegap Plugin
- https://github.com/Wizcorp/phonegap-facebook-plugin
这篇关于Facebook JS SDK可以与Phonegap / Cordova一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!