Browse SDKs · Flutter
Platform
SDKsFlutter

Track message sending progress

Configure the Flutter listener for message sending and media upload progress.

Copy

When delivering local media messages (such as images, video, or audio) using Send a message, configure a send progress listener to receive real-time upload percentage updates:

Code example

OpenIM.iMManager.messageManager.setMsgSendProgressListener(
  OnMsgSendProgressListener(
    onProgress: (clientMsgID, progress) {
      updateMessageUploadProgress(clientMsgID, progress);
    },
  ),
);

Parameters

ParameterTypeRequiredDescription
clientMsgIDStringYesClient message ID of the media message currently being uploaded.
progressintYesCurrent upload progress percentage (0 to 100).

State changes after the call

Associate progress updates with the corresponding message bubble using clientMsgID; never match items by file name or list index. A progress value of 100 signifies solely that the file upload to storage has finished, not that the message has completed server-side delivery. The final delivery state is determined by the Future returned by Send a message.

The SDK does not provide an API to unset this listener. Maintain a single listener instance across your application lifecycle and clear progress mappings when switching accounts. To upload standalone avatars or files outside the messaging pipeline, see Upload a file.