Browse SDKs · React Native
SDKsReact Native

Send an uploaded media message

OpenIM React Native SDK guide for send an uploaded media message.

Copy

Call sendMessageNotOss() to send an image, audio, video, or file message that already contains remote resource URLs. The SDK does not upload these resources again.

const sentMessage = await OpenIMSDK.sendMessageNotOss({
  recvID: receiverUserID,
  groupID: '',
  message: uploadedMessage,
});

Parameters

ParameterTypeRequiredDescription
recvIDstringConditionalRecipient user ID for a direct chat; pass an empty string for a group chat.
groupIDstringConditionalTarget group ID for a group chat; pass an empty string for a direct chat.
messageMessageItemYesMessage created by a URL-based message-creation API.
offlinePushInfoOfflinePushNoOffline push configuration.
isOnlineOnlybooleanNoWhether to deliver only to online clients.

The call returns the sent MessageItem. Resource URLs, sizes, types, and dimensions in message should come from the actual upload result. For local-path media messages, use Send a message.