I've integrated Firebase into my app. I can authenticate with Firebase via email/password. Then I initialize the ChatSDK and call InterfaceManager.shared().a.startLoginActivity(this,true);
From there, the app is "taken over" by the default chat user interface and the functionality works great and ChatSDK.currentUser()
returns the expected User
object.
I would like to do the same thing with my own UI. To authenticate a user after ChatSDK initialization, I've tried:
ChatSDK.auth().authenticateWithCachedToken();
ChatSDK.auth().authenticate(AccountDetails.signUp(email,pwd));
ChatSDK.auth().authenticate(AccountDetails.username(email,pwd));
It is my understanding that I wouldn't be able to do ChatSDK.thread().createThread(...)
until I have a valid User
. However, after each authentication attempt, ChatSDK.currentUser()
is null
.
Looking at the ChatSDK source code and documentation, it appears this is the mechanism for authentication. Is there something I'm missing?
Also, here's some code to start a new chat thread with a known user id.