STWAttachmentApi

object STWAttachmentApi

Functions

Link copied to clipboard
fun addAttachmentOperationListener(    context: Context,     attachmentId: Int?,     cloudServiceListener: CloudServiceListener?): Boolean

Call this method to add a listener to an attachment for a single operation (download or upload).

Link copied to clipboard
fun clearPendingAttachment(context: Context, callback: OperationListener<MessagingError>?)

Call this method to delete pending (non downloaded) attachments.

Link copied to clipboard
suspend fun getAttachmentById(context: Context, attachmentId: Int): STWBaseAttachment?
Link copied to clipboard
fun removeAttachmentOperationListener(    context: Context,     attachmentId: Int?,     cloudServiceListener: CloudServiceListener?)

Call this method if no longer needed to listen for upload or download operation.

Link copied to clipboard
fun sendPurgeAttachmentRequest(context: Context, callback: STWOperationCallback<*>?)

Call this method to send purge attachment request

Link copied to clipboard
fun startDownloadAttachment(    context: Context,     attachmentId: Int?,     progressChanged: (attachmentId: Int, progress: Int, total: Int) -> Unit)
Link copied to clipboard
fun startUploadAttachment(    context: Context,     attachmentId: Int?,     progressChanged: (attachmentId: Int, progress: Int, total: Int) -> Unit,     onSuccess: (attachmentId: Int) -> Unit,     onError: (error: MessagingError) -> Unit)
Link copied to clipboard
fun stopDownloadingAttachment(context: Context, attachmentId: Int?)
Link copied to clipboard
fun stopUploadingAttachment(context: Context, attachmentId: Int?)
Link copied to clipboard
fun updateAudioAttachmentAsPlayed(context: Context, attachmentId: Int)

Call this method when read the audio attachment to update the value of STWBaseAttachment.EXTRA_WAS_PLAYED to true