Messages

interface Messages

This interface is used to interact with messages in a chat room: subscribing to new messages, fetching history, or sending messages.

Get an instance via Room.messages.

Types

Link copied to clipboard
fun interface Listener

An interface for listening to new messaging event

Properties

Link copied to clipboard
abstract val channel: Channel

Get the underlying Ably realtime channel used for the messages in this chat room.

Link copied to clipboard

Add, delete, and subscribe to message reactions.

Functions

Link copied to clipboard
Link copied to clipboard
abstract suspend fun delete(message: Message, operationDescription: String? = null, operationMetadata: OperationMetadata? = null): Message

Delete a message in the chat room.

Link copied to clipboard
abstract suspend fun get(start: Long? = null, end: Long? = null, limit: Int = 100, orderBy: OrderBy = NewestFirst): PaginatedResult<Message>

Get messages that have been previously sent to the chat room, based on the provided options.

Link copied to clipboard
abstract suspend fun send(text: String, metadata: MessageMetadata? = null, headers: MessageHeaders? = null): Message

Send a message in the chat room.

Link copied to clipboard

Subscribe to new messages in this chat room.

Link copied to clipboard
abstract suspend fun update(updatedMessage: Message, operationDescription: String? = null, operationMetadata: OperationMetadata? = null): Message

Update a message in the chat room.