I found a solution to this problem! I think it sho...
# kotlin-native
f
I found a solution to this problem! I think it should exist a better solution for this. So, some feedback would be nice. :D I used
StableRef
to access my object when go back to main thread. Something like this;
Copy code
val chatClientReference = StableRef.create(this)

/* More code */

dispatch_async(dispatch_get_main_queue()) { 
  // access chatClientReference
}
You can check the whole code here if you would like: https://github.com/felipehjcosta/chat-app/commit/b000c0847a8c457adb7cfb32b39eb819aae0e4db