Correct way to recreate the ChatClient? #3971
jeff-huston
started this conversation in
General
Replies: 2 comments 3 replies
-
Note: I just noticed the build warning and changed to |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey @hustoj2,
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have two use cases we need to support:
The first use case is the most important, but the second one also matters.
Currently, I'm using the following approach for both situations:
ChatClient.disconnect()
ChatClient
withChatClient.Builder
and connect using that one.This seems to work functionally, but I do get this error in logcat:
E/Chat: [ERROR] You have just re-initialized ChatClient, old configuration has been overridden [ERROR]
Looking at
ChatClient
's API surface, it seems like for Use Case 1 I could probably just calldisconnect()
and thenconnectUser()
with the new user. But for Use Case 2 I think I do need to recreate theChatClient
. I'd like to follow the same codepath for both use cases, but can diverge if necessary.Are there any drawbacks I should be aware of with my current approach, or a better alternative you would suggest?
Beta Was this translation helpful? Give feedback.
All reactions