StreamShareFileManager

class StreamShareFileManager(fileManager: StreamFileManager = StreamFileManager(), uriProvider: ShareableUriProvider = ShareableUriProvider())

Class handling operations related to sharing files with external apps.

Constructors

Link copied to clipboard
constructor(fileManager: StreamFileManager = StreamFileManager(), uriProvider: ShareableUriProvider = ShareableUriProvider())

Functions

Link copied to clipboard
suspend fun getShareableUriForAttachment(context: Context, attachment: Attachment): Result<Uri>

Gets a shareable URI for an attachment that is already cached. This method does not download the attachment if it's not cached.

Link copied to clipboard
suspend fun writeAttachmentToShareableFile(context: Context, attachment: Attachment, chatClient: () -> ChatClient = { ChatClient.instance() }): Result<Uri>

Writes an attachment to a shareable file in the cache directory and returns a shareable URI. If the attachment is already cached, returns the cached file URI immediately. Otherwise, downloads the attachment from the server and caches it.

Link copied to clipboard
suspend fun writeBitmapToShareableFile(context: Context, bitmap: Bitmap): Result<Uri>

Writes a bitmap to a shareable file in the cache directory and returns a shareable URI.