send User Message
Deprecated
As of 4.17.0, replaced with sendUserMessageFlow(message).
Replace with
sendUserMessageFlow(message)
Content copied to clipboard
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)
Content copied to clipboard
Return
The user message
Since
4.15.0
Parameters
message
The message to send
Deprecated
As of 4.17.0, replaced with sendUserMessageFlow(params).
Replace with
sendUserMessageFlow(params)
Content copied to clipboard
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)
Content copied to clipboard
Return
The user message
Since
4.15.0
Parameters
params
The parameters to send user message