Send a message without OSS
Use the Flutter SDK to send a message that already contains a remote resource URL.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
message | Message | Yes | The prepared message object constructed using a URL-based factory method. |
userID | String? | Required for single chat | Recipient user ID in direct chats. Omit when sending group messages. |
groupID | String? | Required for group chat | Target group ID in group chats. Omit when sending direct messages. |
offlinePushInfo | OfflinePushInfo? | No | Custom offline push notification settings (title, description, and passthrough data). |
isOnlineOnly | bool | No | Whether 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.
Was this page helpful?