ChatStateListener

public interface ChatStateListener

Listener for Chat instance state changes. The current main purpose of this listener is to provide callbacks which notify integrating application about chat session connectivity changes.

Inheritors

Functions

Link copied to clipboard
public abstract Unit onChatRuntimeException(RuntimeChatException exception)

Method is invoked when Chat instance encounters possible exception in a background process. Application should handle these exceptions according to the description of each RuntimeChatException. Some of these exceptions can indicate issues during transfer of messages while others may indicate that further interactions with Chat will be ignored.

Link copied to clipboard
public abstract Unit onConnected()

Method is invoked when chat instance is connected and ready to send/receive messages, events or actions. This happens once initial connection is established or after Chat.reconnect is called.

Link copied to clipboard
public Unit onConnecting()

Method is invoked when the application initiates connection to chat session or if the session was lost and chat attempts automatically to reconnect. Chat should be considered temporarily unavailable until onConnected is invoked.

Link copied to clipboard
public abstract Unit onReady()

Method is invoked when chat instance has finished performing background tasks after connection was established.

Link copied to clipboard
public abstract Unit onUnexpectedDisconnect()

Method is invoked when chat session is unexpectedly lost during initial connection, or if the initial connection was established, but then lost and retry mechanism has been exhausted without success.