MessagesSubscription

A response object that allows you to control a message subscription.

Not suitable for inheritance

This interface is not designed for implementation or extension outside this SDK. The interface definition may evolve over time with additional properties or methods to support new features, which could break implementations.

Functions

Link copied to clipboard
open operator fun component1(): () -> Unit

Syntactic sugar to allow using custom name for unsubscribe handling

Link copied to clipboard
open operator fun component2(): MessagesSubscription

Syntactic sugar to allow using historyBeforeSubscribe with custom unsubscribe handle

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

Get the previous messages that were sent to the room before the listener was subscribed.

Link copied to clipboard
abstract fun unsubscribe()

This method should be called when the subscription is no longer needed, it will make sure no further events will be sent to the subscriber and that references to the subscriber are cleaned up.