Facebook plugin: init not called with valid version

匿名 (未验证) 提交于 2019-12-03 10:03:01

问题:

I use phonegap build to create debug version for android. I want to use facebook plugin. In Config.xml I have

<gap:plugin name="com.phonegap.plugins.facebookconnect" version="0.4.0">     <param name="APP_ID" value="509210995889450" />     <param name="APP_NAME" value="Food share" />   </gap:plugin> 

I use the file facebookConnectPlugin.js which is from the official plugin Github for facebook. calling:

  facebookConnectPlugin.login([], success, fail); 

I get: Error: init not called with valid version Error at Object. (http://connect.facebook.net/en_US/sdk.js:37:148) at window.FB.require (http://connect.facebook.net/en_US/sdk.js:15:588) at window.FB.require (http://connect.facebook.net/en_US/sdk.js:15:550) at window.FB.require (http://connect.facebook.net/en_US/sdk.js:15:550) at window.FB.require (http://connect.facebook.net/en_US/sdk.js:15:550) at window.FB.require (http://connect.facebook.net/en_US/sdk.js:15:550) at window.FB.require (http://connect.facebook.net/en_US/sdk.js:15:550) at window.FB.require (http://connect.facebook.net/en_US/sdk.js:15:550) at window.FB.require (http://connect.facebook.net/en_US/sdk.js:15:550) at window.FB.require (http://connect.facebook.net/en_US/sdk.js:15:550)

回答1:

My mistake was that I tried to work with the official Phonegap plugin for facebook. It seems Phonegap build uses another plugin, which doesn't use javascript facebookConnectPlugin, as is mentioned in their documentation. So I used https://github.com/Wizcorp/phonegap-facebook-plugin And they use https://github.com/phonegap-build/FacebookConnect/tree/962eb0a1c07935ff813e28aa9eaa5581f2e10416 And usage is different. Very confusing. Also makes it difficult if you try first to build on your desktop, and then it doesn't work on Phonegap Build.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!