Handle large attachment uploads and progress
mainThe library supports uploading attachments larger than 100 MB. You can control how upload progress is displayed using the fullUploadStatus property on an Attachment object. There are three implementation strategies:
- No status (Default):
Attachment(fullUploadStatus: nil). Shows no progress indicators. Best if the file is fully uploaded before the message is sent. - Generic progress:
Attachment(fullUploadStatus: .inProgress(nil)). Shows a generic progress indicator for both sender and receiver without a percentage. - Percentage progress:
Attachment(fullUploadStatus: .inProgress(0)). Shows a specific percentage. Requires the client to synchronize multiple WebSocket updates (e.g., 10%, 20%) between sender and receiver.
To manage the lifecycle of the progress indicator, the client must handle these status updates:
- Complete:
Attachment(fullUploadStatus: .complete) - Cancelled:
Attachment(fullUploadStatus: .cancelled) - Error:
Attachment(fullUploadStatus: .error)