Cordova/Phonegap-facebook-plugin Android: facebookConnectPlugin is not defined

拜拜、爱过 提交于 2019-12-06 09:12:39

问题


For Android, I keep getting this error, for this phonegap-facebook-plugin https://github.com/Wizcorp/phonegap-facebook-plugin/issues/758

ReferenceError: facebookConnectPlugin is not defined

I've tried removing all platforms, removing all platforms, and adding just this plugin.

I currently have only these only plugins installed: RoverMR:ionic_git_android rover$ cordova plugin com.phonegap.plugins.PushPlugin 2.3.1 "PushPlugin" com.phonegap.plugins.facebookconnect 0.8.1 "Facebook Connect" org.apache.cordova.device 0.2.12 "Device" RoverMR:ionic_git_android rover$

In my config.xml:

<feature name="org.apache.cordova.facebook.Connect">
    <param name="android-package" value="org.apache.cordova.facebook.ConnectPlugin" />
</feature>

My setup:

RoverMR:ionic_git_android rover$ npm --version 1.4.28 RoverMR:ionic_git_android rover$ cordova -v 4.0.0 RoverMR:ionic_git_android rover$ ionic -v 1.2.8

Any ideas?

Any ideas about the Android issue? What other info should I post to resolve this?For Android, I keep getting this:

ReferenceError: facebookConnectPlugin is not defined

I've tried removing all platforms, removing all platforms, and adding just this plugin.

I currently have only these only plugins installed: RoverMR:ionic_git_android rover$ cordova plugin com.phonegap.plugins.PushPlugin 2.3.1 "PushPlugin" com.phonegap.plugins.facebookconnect 0.8.1 "Facebook Connect" org.apache.cordova.device 0.2.12 "Device" RoverMR:ionic_git_android rover$

In my config.xml:

<feature name="org.apache.cordova.facebook.Connect">
    <param name="android-package" value="org.apache.cordova.facebook.ConnectPlugin" />
</feature>

My setup:

RoverMR:ionic_git_android rover$ npm --version 1.4.28 RoverMR:ionic_git_android rover$ cordova -v 4.0.0 RoverMR:ionic_git_android rover$ ionic -v 1.2.8

Any ideas?

Any ideas about the Android issue? What other info should I post to resolve this?


回答1:


SOVLED! Problem was missing KEY HASH in Facebook App (see developer.facebook.com dashboard, android)

To add a key hash, run keytool (in the SDK you're using the build/run the app)

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

password default seems to be "android"

All other bad passwords will give you the same bad key.

Only the correct password will generate a different, good key.

Put this key into FB.

In Native dev, this error is much more visible. You get a FB error or can see key hash mentioned in error console logs. It'd be nice if this plugin could do the same.




回答2:


I had the same problem; in my case the issue turned out to be that I was using the PhoneGap Developer App which, apparently, doesn't support custom plugins at all.



来源:https://stackoverflow.com/questions/26548555/cordova-phonegap-facebook-plugin-android-facebookconnectplugin-is-not-defined

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