sendFileMessages

fun BaseChannel.sendFileMessages(paramsList: List<FileMessageCreateParams>): Flow<MultipleMessagesResult<FileMessage>>

Deprecated

As of 4.17.0, replaced with sendFileMessagesFlow(paramsList).

Replace with

sendFileMessagesFlow(paramsList)

Send file messages

channel.sendFileMessagesFlow(paramsList)
.onEach {
when (it) {
is MultipleMessagesResult.Pending -> {
// called it when sending file messages are started
// it contains pendingMessageList
}
is MultipleMessagesResult.EachSucceed -> {
// each file sending completed
// it.message is a succeeded file message
}
is MultipleMessagesResult.EachFailure -> {
// each file sending failed
// it.failedMessage is a failed file message
// it.e is a cause of failure
}
}
}.catch {
// called it when request failed (validation failure)
}.onCompletion {
// called it when all all file messages are completed
}.launchIn(viewModelScope)

Return

The file messages result

Since

4.15.0

Parameters

paramsList

List of params of file message. Refer to FileMessageCreateParams. Null is ignored

See also

FileMessageCreateParams