downloadAttachment

fun ChatClient.downloadAttachment(context: Context, attachment: Attachment, generateDownloadUri: (Attachment) -> Uri, interceptRequest: DownloadManager.Request.() -> Unit): Call<Unit>

Downloads the selected attachment to the "Download" folder in the public external storage directory.

Return

Executable async Call downloading attachment.

Parameters

context

The context used to access the DownloadManager.

attachment

The attachment to download.

generateDownloadUri

The function that generates the download URI for the attachment.

interceptRequest

The function that intercepts the DownloadManager.Request before it's enqueued.