subscribeFor

Subscribes to client events of type T.


inline fun <T : ChatEvent> ChatClient.subscribeFor(lifecycleOwner: LifecycleOwner, listener: ChatEventListener<T>): Disposable

Subscribes to client events of type T, in the lifecycle of lifecycleOwner.

Only receives events when the lifecycle is in a STARTED state, otherwise events are dropped.


Subscribes to the specific eventTypes of the client.


fun ChatClient.subscribeFor(lifecycleOwner: LifecycleOwner, vararg eventTypes: KClass<out ChatEvent>, listener: ChatEventListener<ChatEvent>): Disposable

Subscribes to the specific eventTypes of the client, in the lifecycle of lifecycleOwner.

Only receives events when the lifecycle is in a STARTED state, otherwise events are dropped.