简体   繁体   English

FBSession checkThreadAffinity

[英]FBSession checkThreadAffinity

I have used facebook authentication via facebook's SDK. 我通过facebook的SDK使用了facebook身份验证。 If fbaccount is available then it's working fine but in the absent of fbaccount it crashes with this error: 如果fbaccount可用,那么它工作正常,但在缺少fbaccount时它会崩溃并出现此错误:

FBSession checkThreadAffinity FBSession checkThreadAffinity

I am using this code for the auth process 我正在使用此代码进行身份验证过程

Please check what I am doing wrong in above code. 请检查我在上面的代码中做错了什么。

I had the same issue. 我遇到过同样的问题。 The problem was that I was trying to call methods om the [FBSession activeSession] or any FBSession static method from another thread. 问题是我试图从另一个线程调用[FBSession activeSession]或任何FBSession静态方法的方法。 My conclusion is that the FBSession object is not thread safe. 我的结论是FBSession对象不是线程安全的。

I cannot find any issue in your code. 我在您的代码中找不到任何问题。 However, check when you first call the FBSession object, is it called from the main thread? 但是,检查第一次调用FBSession对象时,是否从主线程调用? If its not, that could be the cause. 如果不是,那可能是原因。

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

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