问题
I have Senscha 2.0 mobile application which I want to build using latest phonegap (cordova).
I want to add facebook login functionality. I found three options:
- Use ChildBrowser approach
- Use InAppBrowser.
- Use cordova facebook plugin
I decided to go with the second one.
I have problem with domain in FB app settings (Mobile Site URL).
I typed one of my 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 on my iPhone (using as website in Safari).
To be more precise.
Facebook JS SDK works 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.
Will Facebook JS SDK work with Phonegap / Cordova?
回答1:
It can. Use OpenFB or Facebook Connect Phonegap Plugin.
Reference
OpenFb
- http://coenraets.org/blog/2014/04/facebook-phonegap-cordova-without-plugin/
- https://github.com/ccoenraets/OpenFB
Facebook Connect Phonegap Plugin
- https://github.com/Wizcorp/phonegap-facebook-plugin
来源:https://stackoverflow.com/questions/15288177/can-facebook-js-sdk-work-with-phonegap-cordova