Hello, I’ve encountered the following issue when sending a file message with custom data in params. So, my aim is to be able to send audio files, m4a format, and setting a specific value to customType field. Previously we’ve been sending the files just by passing the file url to the sendDocumentFileMessage method, which was working fine and the returned file URL was decoded successfully as an m4a file.
Unfortunately, when building the message params myself, the upload works fine, but the returnded URL is no longer m4a (at least the url path). I thought that maybe my implementation missed something so I’ve checked the implementation here and did pretty much the same stuff as for send document files.
Below is my code:
func sendAudioMessage(with url: URL) {
guard let data = try? Data(contentsOf: url),
let mimeType = SBUUtils.getMimeType(url: url),
let params = SBDFileMessageParams(file: data) else { return }
params.fileName = "Audio message"
params.fileSize = UInt(data.count)
params.customType = "AUDIO_MESSAGE"
params.mimeType = mimeType
SBUGlobalCustomParams.fileMessageParamsSendBuilder?(params)
sendFileMessage(messageParams: params)
}
I am wondering what I might be missing, because if I just send it using the sendDocumentFile method it works fine (but I need to be able to set custom params to the message before sending it)
UIKit version: [v2.1.12]
Thanks!