SDKsReact Native
Send uploaded media message
Send a pre-uploaded media message using remote URLs without triggering SDK file upload using the OpenIM React Native SDK.
Send an image, audio, video, or file message that already contains accessible remote URLs:
When your application hosts media assets on a private cloud or has completed file uploads independently, use this method to dispatch messages directly, bypassing the SDK's internal file upload workflow.
const sentMessage = await OpenIMSDK.sendMessageNotOss({
recvID: receiverUserID,
groupID: '',
message: uploadedMessage,
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
recvID | string | Conditional | Recipient user ID for one-to-one chats; pass an empty string "" for group chats. |
groupID | string | Conditional | Target group ID for group chats; pass an empty string "" for one-to-one chats. |
message | MessageItem | Yes | Message object constructed via URL-based message creation methods. |
offlinePushInfo | OfflinePush | No | Custom offline push notification title, content, and passthrough payload. |
isOnlineOnly | boolean | No | Whether to deliver solely to currently online clients without storing in server offline history. |
Return value
A resolved Promise returns the dispatched MessageItem containing server-assigned fields including serverMsgID, sendTime, and updated status.
State changes and lifecycle phases
- Promise resolution: Indicates the message with remote URLs has been written to local storage and delivered to the server queue.
- Event arrival: Because the media asset is already hosted remotely, no upload progress events are triggered. Recipient clients receive normal incoming message notifications.
- Re-query reconciliation: In offline or uncertain network conditions, re-query conversation history via Load older messages.
Always reconcile local message status using clientMsgID. For local filesystem assets requiring automatic SDK uploads, use Send message.
Was this page helpful?