Skip to content
kristiyan-petrov edited this page May 3, 2024 · 4 revisions

Get active chats

You can get the active chats with the following code

KaleyraVideo.conversation.chats.onEach {  }.launchIn(MainScope())

Place a chat

To start a chat please refer to the following snippet

KaleyraVideo.conversation.chat(currentActivity, listOf("userB")): Result<ChatUI> 

Listen for chat events/errors

To observe a chat that has started, has ended or has ended with an error is it necessary to listen for the chat state flow.

chat.state.onEach { chatState ->
   Log.d("CHAT STATE", "$chatState")
}.launchIn(MainScope())

Update displayed chat actions

Chat actions represents capabilities that are enabled on the chat UI. To update or modify the call actions please refer to the following snippet:

KaleyraVideo.conversation.chatActions = ChatUI.Action.default

Please follow the ChatUI.Action documentation to get all the available actions.

Clone this wiki locally