SDKsWASM
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. Merge the returned object by clientMsgID. For field descriptions, see Message overview.
This method does not upload the resource and must not be used for a message that still contains only a local file.
Was this page helpful?