resendMessageFlow

fun BaseChannel.resendMessageFlow(userMessage: UserMessage): Flow<MessageResult<UserMessage>>

Resends a failed user message.

Return

The user message

Since

4.17.0

Parameters

userMessage

Failed userMessage.


fun BaseChannel.resendMessageFlow(fileMessage: FileMessage): Flow<MessageResult<FileMessage>>

Resend message with the original file object set when the file message was sent.

** Sample code **

baseChannel.resendMessageFlow(fileMessage)
.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 file message

Since

4.17.0

Parameters

fileMessage

The file message to resend


fun GroupChannel.resendMessageFlow(multipleFilesMessage: MultipleFilesMessage): Flow<MultipleFilesMessageResult>

Resends multiple files or file URLs as a single MultipleFilesMessage.

Return

The Flow of MultipleFilesMessageResult. Or throw SendbirdException if request failed.

Since

4.17.0

Parameters

multipleFilesMessage

Failed multiple files message.