2

I am trying to install a facebook integration in the simplest way with phonegap build.

Did the following:

  1. added this to config.xml:

<gap:plugin name="com.phonegap.plugins.facebookconnect" version="0.9.0">
     <param name="APP_ID" value="****************" />
      <param name="APP_NAME" value="******" />
 </gap:plugin>
  1. made sure the plugin appears on installed plugins on phonegap build:
    it appears as it should.
    Plugin Source Version Latest Platforms
    com.phonegap.plugins.facebookconnect pgb 0.9.0 0.9.0 android,ios

those two steps are all I should have done according to documentation: https://github.com/Wizcorp/phonegap-facebook-plugin/blob/master/platforms/pg-build/README.md

but when I try to use the plugin I get "ReferenceError: facebookConnectPlugin is not defined"

Did I miss anything? Anyone else encountered this situation?

thanks.

tomermes
  • 22,950
  • 16
  • 43
  • 67
  • Instead of doing it manually, try to install it automatically . It will be a cleaner installation that the manual one. cordova cordova plugin add "github url of the plugin" . I guess yours is -> with "https://" + github.com/Wizcorp/phonegap-facebook-plugin/ – shamaleyte Jul 04 '15 at 10:03
  • I am also having this issue. Did you ever find a solution? I believe I've got the right android hash set in Facebook. Everything works fine on iOS, but on Android I'm getting the "ReferenceError: facebookConnectPlugin is not defined" error. I would greatly appreciate any help with this issue. – oalbrecht Oct 24 '15 at 03:37
  • Yes I added to index.html this: with the relevant file in the www folder – tomermes Oct 24 '15 at 21:12
  • Did you ever find a solution for this, I have the exact same setup and issue. – Jester Nov 15 '15 at 22:26

2 Answers2

0

I haven't had a chance to try this yet, but this version ("0.9.0") was released last year in November. It is currently up to version 0.12.0. You can either specify this version or omit it to use this particular version, but for the sake of its recommendation, I am going to stick with trying 0.9.0 for now.

If you inspect this repository, look to the folder:

./www/phonegap/plugin/facebookConnectPlugin/

So tonight I"ll be trying to include the <script> for the facebookConnectPlugin.js. Looking to the source, it appears to have the dependency of the Facebook JS file, so prepare your head to include that first.

Let me know if you try this and if it succeeds or fails before I try it tonight. Good luck!

Jester
  • 399
  • 2
  • 3
  • 15
  • Just noticed your comment to reflect you have tried to add the JS resource to the `` tag, I am very excited to try it tonight! – Jester Nov 16 '15 at 04:30
0

@joel234,
Okay. First thing. The solution I am going to post is for Phonegap Build, the solution does not apply to Cordova, per se.

For the last several weeks, i've been posting this again and again, the plugin com.phonegap.plugins.facebookconnect is deprecated, as in obsolete. This means you *should* not use it. You should use a much more up to date version.

In addition, it appears you are not following the blogs. Otherwise you'd know that you should be using source=npm AND the names with periods in it have also be deprecated.

You can read the detail here: Facebook connect plugin is not working (...)

Your new plugin setting is:

<gap:plugin name="cordova-plugin-facebookconnect-orlando" source="npm" version="0.11.0">

In addition, I strongly suggest you read the bold sentences in the following.

Top Mistakes by Developers new to Cordova/Phonegap

If this works, as expected, Can you tell me where you found this example, so I can speak to the author and have it corrected. TIA - Best of Luck

Community
  • 1
  • 1