send File Messages With Progress
fun BaseChannel.sendFileMessagesWithProgress(paramsList: List<FileMessageCreateParams>): Flow<ProgressMultipleMessagesResult<FileMessage>>
Deprecated
As of 4.17.0, replaced with sendFileMessagesWithProgressFlow(paramsList).
Replace with
sendFileMessagesWithProgressFlow(paramsList)
Content copied to clipboard
Sends files with given files information and gets callback for uploading progress. The maximum number of files is 20. This method handles FileMessageCreateParams only which have set binary file not URL.
** Sample code **
channel.sendFileMessagesWithProgressFlow(paramsList)
.onEach {
when (it) {
is ProgressMultipleMessagesResult.Pending -> {
// called it when sending file messages are started
// it contains pendingMessageList
}
is ProgressMultipleMessagesResult.EachSucceed -> {
// each file sending completed
// it.message is a succeeded file message
}
is ProgressMultipleMessagesResult.EachFailure -> {
// each file sending failed
// it.failedMessage is a failed file message
// it.e is a cause of failure
}
is ProgressMultipleMessagesResult.Progress -> {
// called when sending file messages are uploading
}
}
}.catch {
// called it when request failed (validation failure)
}.onCompletion {
// called it when all all file messages are completed
}.launchIn(viewModelScope)
Content copied to clipboard
Return
The file message progress result
Since
4.15.0
Parameters
params List
List of params of file message. Refer to FileMessageCreateParams. Null is ignored
See also
File Message Create Params