Search code examples
androidfacebookcordovaphonegap-plugins

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


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?


Solution

  • 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.