Browse SDKs · React Native
Platform
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.

Copy

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

ParameterTypeRequiredDescription
recvIDstringConditionalRecipient user ID for one-to-one chats; pass an empty string "" for group chats.
groupIDstringConditionalTarget group ID for group chats; pass an empty string "" for one-to-one chats.
messageMessageItemYesMessage object constructed via URL-based message creation methods.
offlinePushInfoOfflinePushNoCustom offline push notification title, content, and passthrough payload.
isOnlineOnlybooleanNoWhether 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

  1. Promise resolution: Indicates the message with remote URLs has been written to local storage and delivered to the server queue.
  2. Event arrival: Because the media asset is already hosted remotely, no upload progress events are triggered. Recipient clients receive normal incoming message notifications.
  3. 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.