sippo-sdk / com.quobis.sippo.sipposdk.chat / Chats

Chats

class Chats

Properties

currentState

lateinit var currentState: State

Current XMPP session state.

rx

val rx: ChatsRx

Functions

addListener

fun addListener(listener: ChatsListener): Unit

Adds a listener to receive different chats events.

connect

fun connect(isDebugEnabled: Boolean = false): Unit

Connects a chat session.

disablePushNotifications

fun disablePushNotifications(onCompletion: (SippoClientError?) -> Unit): Unit

Disable the reception of chat push notifications.

disconnect

fun disconnect(): Unit

Disconnects a chat session and disables the chat push notifications. This should be called on logout.

enablePushNotifications

fun enablePushNotifications(context: Context, onCompletion: (SippoClientError?) -> Unit): Unit

Enable the reception of chat push notifications. In order to enable them you need to have registered a Firebase push token beforehand (@see Sessions' setPushToken method).

removeListener

fun removeListener(listener: ChatsListener): Unit

Removes the specified listener.

suspend

fun suspend(): Unit

Suspends a chat session. This should be called when the app enters background in order to receive chat push notifications.