我正在使用Facebook模块4.0.5,Titanium SDK 5.1.0 GA。我的开发平台是iOS。
我设置时,Facebook登录工作正常
forceDialogAuth= true.
但是当我在设备或模拟器中使用forceDialogAuth= false
进行测试时,它会在Safari中打开登录窗口。提供我的凭据并登录后。它返回到app但没有任何反应,即fb.loggedin
条件内的代码永远不会执行。主要原因是显示响应需要很长时间。这是我得到的回应
{"code":5,"error":"OTHER: Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x7aeb9800 {com.facebook.sdk:ErrorInnerErrorKey=Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x7aed8d60 {NSErrorFailingURLStringKey=https://graph.facebook.com/v2.2, NSErrorFailingURLKey=https://graph.facebook.com/v2.2, NSLocalizedDescription=The request timed out., NSUnderlyingError=0x7b91f620 "The request timed out."}, com.facebook.sdk:HTTPStatusCode=200, com.facebook.sdk:ErrorSessionKey=<FBSession: 0x7ae6c1d0, state: FBSessionStateClosed, loginHandler: 0x0, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x7b921680>, expirationDate: (null), refreshDate: (null), attemptedRefreshDate: 0000-12-30 00:00:00 +0000, permissions:(null)>}","success":false,"cancelled":false,"bubbles":true,"type":"login","source":{"id":"facebook"},"cancelBubble":false}
是否有人熟悉此类错误。我不明白为什么这个错误会继续发生。我只是尝试登录用户授权我的应用程序。我有这些权限设置。
fb.permissions = ['public_profile', 'email'];
答案 0 :(得分:0)
截至2015年4月30日,Facebook不再支持其API版本1.0,其中包括FQL和REST API。仅支持Graph API。要与FB的API兼容,这要求您至少应使用Ti Facebook模块版本4.0 +
调试Ti FB模块版本&lt; 4.0
时没用答案 1 :(得分:0)
新版本的模块要求您向tiapp.xml
添加一些密钥:
https://github.com/appcelerator-modules/ti.facebook/tree/master/ios#module-api
这也在文档中,但我看到格式化不好,所以它并不那么明显。我会解决这个问题。
http://docs.appcelerator.com/platform/latest/#!/api/Modules.Facebook