2

I am developing Android App with Monaca IDE and trying to use cordova phonegap-facebook-plugin to implement Facebook Login.

The issue is even I follow the instruction in this thread

I have put the correct key (since it says if I giving wrong password it will always give u same bad key) in Facebook App setting.

It still throw "ReferenceError: facebookConnectPlugin is not defined" When I called facebookConnectPlugin.login function.

I have done lots research but still getting same error.

Can anyone who successful integrate this plugin in to Monaca IDE with android app give me some advise?

Glenn Hung
  • 23
  • 2

3 Answers3

2

Monaca already provides a sample application that can be used for facebook login, have you tried to use it? Here you can find the documentation:

http://docs.monaca.mobi/cur/en/sampleapp/samples/facebook

Andi Pavllo
  • 2,506
  • 4
  • 18
  • 30
  • Thanks Andi, yes I have tried this and it works as in-app browser, but what I am trying to is to integrate the native facebook login dialog not browser one :), thanks for reply. – Glenn Hung Feb 23 '15 at 08:35
  • sorry but I never tried to import that plugin, I'll take a look and, in case, inform you ;) – Andi Pavllo Feb 23 '15 at 08:48
0

I received an official response from Monaca that this plugin is not supported. At first they gave a canned answer (generic instructions on importing a custom plugin). I then asked for them to try to import the plugin and make it work on their own, and they couldn't. Sigh.

Ben McMillan
  • 578
  • 4
  • 12
  • That's pretty sad since native facebook integration is very important in user experience :(......I have sent the customer support also and got canned answer too, sigh. – Glenn Hung Apr 29 '15 at 08:01
0

Hi try to add this code !

document.addEventListener("deviceready", onDeviceReady, false);
        function onDeviceReady(){
            window.facebookConnectPlugin.login(["email"], function(response) 
            {
                alert("facebookConnectPlugin.login");

                if (response.authResponse) 
                {
                    alert('User is loggedd in');
                    //login success
                } else  {
                    alert('User is not logged in');
                }
        });
}

Try to build the app (APK) not in debugger mode (web or debugger)