Browse SDKs · Flutter
Platform
SDKsFlutter

Send a message without OSS

Use the Flutter SDK to send a message that already contains a remote resource URL.

Copy

Send media messages (such as images, audio, video, or files) that already contain remote resource URLs, bypassing the SDK's internal OSS upload pipeline:

Parameters

ParameterTypeRequiredDescription
messageMessageYesThe prepared message object constructed using a URL-based factory method.
userIDString?Required for single chatRecipient user ID in direct chats. Omit when sending group messages.
groupIDString?Required for group chatTarget group ID in group chats. Omit when sending direct messages.
offlinePushInfoOfflinePushInfo?NoCustom offline push notification settings (title, description, and passthrough data).
isOnlineOnlyboolNoWhether the message is online-only; defaults to false.

Code example

final sent = await OpenIM.iMManager.messageManager.sendMessageNotOss(
  message: urlMessage,
  userID: receiverUserID,
  offlinePushInfo: offlinePushInfo,
);

Set only userID for direct chats, and set only groupID for group chats. These target parameters are mutually exclusive.

Return value

Returns a Future resolving to the server-confirmed Message object. Update the local message list using its non-empty clientMsgID.

State changes after the call

This method is designed for messages whose media files have already been uploaded by external services; the SDK does not perform secondary uploads on media assets. If media files exist only on the local device and require SDK uploading, use Send a message. For corresponding URL message factory methods, see Create an image message from URLs, Create an audio message from a URL, Create a video message from URLs, and Create a file message from a URL.