customer-android-kotlin

//core/com.kustomer.core.listeners/KusChatListener

KusChatListener

[androidJvm]
interface KusChatListener

Listener interface for retrieving Chat updates for every active conversation

Samples

[androidJvm]
ExampleChatListener

Functions

Name Summary
onAgentIsTyping [androidJvm]
abstract fun onAgentIsTyping(conversationId: String, typingIndicator: KusTypingIndicator)
Called when the agent has begun typing and when they have stopped typing.
onAgentJoined [androidJvm]
abstract fun onAgentJoined(conversationId: String, agent: KusUser)
Called when an agent responds to a conversation for the first time
onAssistantEnded [androidJvm]
abstract fun onAssistantEnded(conversation: KusConversation)
Called when a conversation object gets updated This event is triggered when the chat assistant ends, and session is not in assistant mode anymore
onChatMessageReceived [androidJvm]
abstract fun onChatMessageReceived(conversationId: String, chatMessage: KusChatMessage)
Called when a chat message has been received from both the agent or the customer itself Check the KusChatMessage.direction property to see if the message was sent by agent or by the customer If the message is sent by agent, check the KusChatMessage.sentByUser information to get the agent information i.e Agent’s name and icon
onConversationCreated [androidJvm]
abstract fun onConversationCreated(conversation: KusConversation)
Called when a conversation is created. This can be used to then describe custom attributes for a conversation using the KusConversation.id
onConversationDeleted [androidJvm]
abstract fun onConversationDeleted(conversation: KusConversation)
Called when a conversation is deleted by an agent.
onConversationEnded [androidJvm]
abstract fun onConversationEnded(conversation: KusConversation)
Called when a conversation is ended. Check the KusConversation.lockReason to see the lock reason
onConversationLastMessageAtChanged [androidJvm]
abstract fun onConversationLastMessageAtChanged(conversationId: String, lastMessageAt: Long)
Called when a new message is received for a conversation which changes the last message timestamp KusConversation.lastMessageAt is used to represent the time of the last message sent for a conversation on the UI
onConversationMerged [androidJvm]
abstract fun onConversationMerged(source: KusConversation, target: KusConversation)
Called when Agent merges 2 conversations of the same user from the Agent UI Source conversation should not be used to send messages to anymore. All the messages from source conversation will automatically be merged with the target conversation on the Backend.
onConversationUnended [androidJvm]
abstract fun onConversationUnended(conversation: KusConversation)
Called when a conversation is unended i.e. reopened by an Agent
onCustomerDeleted [androidJvm]
abstract fun onCustomerDeleted()
Called when a customer is deleted by an agent
onCustomerMerged [androidJvm]
abstract fun onCustomerMerged(customerId: String)
Called when a customer is merged with a different customer
onPreviewChanged [androidJvm]
abstract fun onPreviewChanged(conversationId: String, preview: KusConversationPreview)
Called when a new message is received for a conversation which changes the preview text KusConversation.preview text is used to show the last message text for a conversation on the UI
onSatisfactionEventReceived [androidJvm]
abstract fun onSatisfactionEventReceived(conversationId: String, satisfaction: KusSatisfaction)
Called when a Satisfaction feedback form sent for a closed conversation. This event is triggered after the specified delay time configured in Satisfaction settings in Kustomer.
onUnreadCountChange [androidJvm]
abstract fun onUnreadCountChange(conversationId: String, unreadCount: Int)
Called when unread count is updated for a conversation This method will be called whenever a new message is received for a conversation from both the agent or the user This method will also be called when a conversation is marked as read, and the unread count resets to Zero