简体   繁体   English

Appcelerator Titanium-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. 我已将facebook模块( https://github.com/appcelerator-modules/ti.facebook )添加到我的应用程序中,并按照页面上的说明进行操作。

When I invoke Alloy.Globals.Facebook.authorize(); 当我调用Alloy.Globals.Facebook.authorize(); I get an error: Uncaught undefined is not a constant in com.facebook.login.LoginBehavior 我收到一个错误: Uncaught undefined is not a constant in com.facebook.login.LoginBehavior

在此处输入图片说明

Same code is working on iOS. 相同的代码在iOS上运行。 What should I be doing to make this work on Android? 我应该怎么做才能在Android上实现此功能?

The error is not with the Alloy.Globals.Facebook.authorize(); 该错误与Alloy.Globals.Facebook.authorize(); statement, you need look for statment like fb.setLoginBehavior(fb.LOGIN_BEHAVIOR_NATIVE); 语句,您需要查找类似fb.setLoginBehavior(fb.LOGIN_BEHAVIOR_NATIVE);语句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. 否则,只需尝试在方法中设置此LOGIN_BEHAVIOR_DEVICE_AUTH属性。

In my opinion you can comment and remove the statement, as this method might not work for android. 我认为您可以注释和删除该语句,因为此方法可能不适用于android。

Good Luck & Cheers 祝你好运

Ashish Sebastian 艾希什·塞巴斯蒂安(Ashish Sebastian)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM