sendUserMessage

fun BaseChannel.sendUserMessage(message: String): Flow<MessageResult<UserMessage>>

Deprecated

As of 4.17.0, replaced with sendUserMessageFlow(message).

Replace with

sendUserMessageFlow(message)

Send user message

** Sample code **

baseChannel.sendUserMessageFlow(paramsList)
.onEach {
when (it) {
is MessageResult.Pending -> {
// called it when sending message are called
// it contains pendingMessage
}
is MessageResult.Succeed -> {
// called it with result data when all job has been completed
}
is MessageResult.Failure -> {
// deliver exception with failed message when all job has been completed
// it.message : failed message
// it.e : exception
}
}
}.catch {
// error occurred (validation failed)
}.launchIn(viewModelScope)

Return

The user message

Since

4.15.0

Parameters

message

The message to send


fun BaseChannel.sendUserMessage(params: UserMessageCreateParams): Flow<MessageResult<UserMessage>>

Deprecated

As of 4.17.0, replaced with sendUserMessageFlow(params).

Replace with

sendUserMessageFlow(params)

Send user message ** Sample code **

baseChannel.sendUserMessageFlow(params)
.onEach {
when (it) {
is MessageResult.Pending -> {
// called it when sending message are called
// it contains pendingMessage
}
is MessageResult.Succeed -> {
// called it with result data when all job has been completed
}
is MessageResult.Failure -> {
// deliver exception with failed message when all job has been completed
// it.message : failed message
// it.e : exception
}
}
}.catch {
// error occurred (validation failed)
}.launchIn(viewModelScope)

Return

The user message

Since

4.15.0

Parameters

params

The parameters to send user message