mgcrea / cordova-facebook-connect

Cordova ARC plugin for the Facebook SDK
94 stars 43 forks source link

Deprecated at login - Cordova 2.0 #4

Closed ghost closed 11 years ago

ghost commented 11 years ago

I'm trying to use this plugin to connect to FB and get the user token. I've followed every step mentioned in the readme.

I'm using Cordova(PhoneGap) 2.0, Android, Samsung Galaxy S2

Upon calling the login button, my app goes into an infinite loop with the message: "This method will be deprecated December 2012", after which, it crashes soon with a stack overflow message.

ghost commented 11 years ago

Upon going through the plugin code, I noticed the use of this deprecated function in the login function: this.cordova.getContext()

Overriding this function in main activity helped.

@Override
public Context getContext() {
    LOG.d(TAG, "This will be deprecated December 2012");
    return this;
}
mgcrea commented 11 years ago

As you can see in the comments here : http://simonmacdonald.blogspot.fr/2012/07/phonegap-android-plugins-sometimes-we.html, the deprecated log is an error from the Cordova team.

I'll investigate your crash further, what is your exact Android version on your S2?

mgcrea commented 11 years ago

Moreover do you have the Facebook app installed? is it up-to-date ? Do you see it starting (it goes for SSO?)?

ghost commented 11 years ago

Hi. I'm using Android 2.3.3 (Build Number: GINGERBREAD.XWKF3) on my phone. Yes, I do have the FB app installed, and it is up-to-date.

I'm not sure what you mean by your last question. Can you please elaborate?

Thanks!

mgcrea commented 11 years ago

On the first login, your app should go to the background while the facebook app is coming to the front. Do you see that? It looks like PhoneGap/Cordova had some recursive issues in previous version. You should pull my latest changes & try with PhoneGap 2.0