Send an uploaded media message
Send a file, image, audio, or video message that already contains a remote resource URL.
Use sendMessageNotOss() when a file, image, audio, or video has already received a URL from your application's upload service. This avoids entering the SDK's built-in upload flow again.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
recvID | string | Conditional | Recipient's user ID for a one-to-one chat. Pass an empty string for a group chat. |
groupID | string | Conditional | Target group ID for a group chat. Pass an empty string for a one-to-one chat. |
message | MessageItem | Yes | Pending message returned by a URL-based creation API and already containing remote resource information. |
offlinePushInfo | OfflinePush | No | Offline push title, description, and platform configuration. |
isOnlineOnly | boolean | No | Whether to deliver only to online clients. Online-only messages are not stored in local history. |
const { data: sentMessage } = await openimsdk.sendMessageNotOss({
recvID: receiverUserID,
groupID: '',
message: urlMessage,
});The resource URL, size, type, dimensions, and duration must come from the actual upload result.
When the Promise resolves, data is the server-confirmed MessageItem. Use clientMsgID to find and update the local pending message. For field descriptions, see Message overview.
This method does not perform file uploads and must not be used for messages that still contain local file objects. To use the SDK's built-in upload pipeline, create the message using the corresponding file-based method and then call Send a message.
Was this page helpful?