Chat
Current chat instance. Client is not limited to a single instance of any given chat. They can create (or rather build) as many instances as they like. They are though advised that creating CONFLICTING (or identical) instances with the same configuration may lead to unexpected consequences.
After creating an instance via build, the customer is automatically authorized if the authorization is enabled and the customer was not previously authorized, otherwise reconnects the customer. The created chat instance also starts listening for the authorization and updates customer details after customer authorization. The time it takes to reach the device is undefined.
Moreover, it starts listening to events that modify welcome messages. Therefore, a welcome message is only available after we receive the given event and requires no actions from the client side. The time it takes to reach the device is undefined.
Properties
Current options of the channel as received from the backend. It will remain unchanged while this Chat instance exists.
Current environment provided by the SocketFactoryConfiguration. It will remain unchanged for the duration while this object exists.
Current collection of global customer CustomFields set in SDK. Instance provided by the method won't be updated if the CustomFields collection is updated in the Chat, it should be considered as a snapshot of current state. Values can be updated from backend, after ChatThreadsHandler.refresh call.
Functions
Returns new instance of an action handler for this Chat.
Attempts to connect the chat session using existing configuration, the attempt will be made on background thread. Successful connection will be announced to the ChatStateListener.onConnected which was supplied in ChatBuilder. If there is an issue during/after reconnection the ChatStateListener.onUnexpectedDisconnect will be called, it is responsibility of application to perform a repeated reconnection attempt, if it is desirable. Reconnect attempts should be performed only if the device is connected to the internet. If the repeated reconnection attempts are made, they should be called with exponential backoff, in order to prevent backend overload.
Creates new instance to modify global custom fields.
Creates new instance to interact with this instance.
Attempts to restart the chat session using existing configuration, the attempt will be made on background thread. Successful connection will be announced to the ChatStateListener.onConnected which was supplied in ChatBuilder. If there is an issue during/after reconnection the ChatStateListener.onUnexpectedDisconnect will be called, it is responsibility of application to perform a repeated reconnection attempt, if it is desirable. Reconnect attempts should be performed only if the device is connected to the internet. If the repeated reconnection attempts are made, they should be called with exponential backoff, in order to prevent backend overload.
Sets device token (notification push token) to this instance and transmits it to the server. It's not guaranteed that the token is delivered to the server though. Therefore, clients are strongly advised to call this method every time they receive new tokens and reconnect to this instance.
Attempts to change username if the channel configuration allows setting of the username. All subsequent events sent from chat will have new value filled out.
Creates new instance to observe and interact with Threads.