Search code examples
titaniumappceleratorappcelerator-titaniumappcelerator-facebook

Appcelerator Titanium - failed Facebook module login


I've added the facebook module (https://github.com/appcelerator-modules/ti.facebook) to my app and followed the instructions on page.

When I invoke Alloy.Globals.Facebook.authorize(); I get an error: Uncaught undefined is not a constant in com.facebook.login.LoginBehavior

enter image description here

Same code is working on iOS. What should I be doing to make this work on Android?


Solution

  • The error is not with the Alloy.Globals.Facebook.authorize(); statement, you need look for statment like fb.setLoginBehavior(fb.LOGIN_BEHAVIOR_NATIVE);, Just try and comment the statement and see this would do the trick.

    Or else just try and set this LOGIN_BEHAVIOR_DEVICE_AUTH property in the method.

    In my opinion you can comment and remove the statement, as this method might not work for android.

    Good Luck & Cheers

    Ashish Sebastian