ChatsRx

class ChatsRx

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Contains the list of all chat instances associated with the current user.

Link copied to clipboard

Contains the list of group chat instances associated with the current user.

Link copied to clipboard

Contains the list of individual chat instances associated with the current user.

Link copied to clipboard
val groupChatAdded: Observable<Chat>

Emits when a group Chat is created.

Link copied to clipboard
val groupChatRemoved: Observable<Chat>

Emits when a group Chat is removed.

Link copied to clipboard
val groupChatUpdated: Observable<Chat>

Emits when a group Chat is updated.

Link copied to clipboard
val individualChatAdded: Observable<Chat>

Emits when a individual Chat is created.

Link copied to clipboard
val individualChatRemoved: Observable<Chat>

Emits when a individual Chat is removed.

Link copied to clipboard
val individualChatUpdated: Observable<Chat>

Emits when an individual Chat is updated.

Link copied to clipboard
val state: Observable<XmppClient.State>

Emits the XMPP session state whenever it changes. When a subscriber is added, it will also emit the current value.

Functions

Link copied to clipboard
fun connect(isDebugEnabled: Boolean = false): Completable

Connects a chat session.

Link copied to clipboard
fun createChat(creationType: CreationType): Single<Chat>

Creates a new chat.

Link copied to clipboard
fun disablePushNotifications(): Completable

Disables the Push Notifications for incoming messages. Disables notifications against XMPP server.

Link copied to clipboard
fun disconnect(): Completable

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

Link copied to clipboard
fun enablePushNotifications(): Completable

Enables the Push Notifications for incoming messages. Enable notifications against XMPP server. It must be called after setPushToken or to have the dnd option disabled in order for it to work.

Link copied to clipboard
fun getAllChats(): Single<List<Chat>>

Fetches both individual and group chats related to this user.

Link copied to clipboard
fun getGroupChats(): Single<List<Chat>>

Fetches all group chats related to this user.

Link copied to clipboard
fun getIndividualChats(): Single<List<Chat>>

Fetches all individual chats related to this user.

Link copied to clipboard
fun joinGroupChats(): Completable

Joins all the group chats in the list of currentGroupChats.

Link copied to clipboard
fun restore(isDebugEnabled: Boolean = false): Completable

Restores the active xmpp session..

Link copied to clipboard
fun suspend(): Completable

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