Browse SDKs · React Native
Platform
SDKsReact Native

Find messages by ID

Locate specific messages by conversation ID and client message IDs using the OpenIM React Native SDK.

Copy

Look up specific messages by conversation ID and client message ID list:

This query is ideal when jumping directly to a referenced message from search results, quoted replies, system notices, or offline push notifications.

const result = await OpenIMSDK.findMessageList([
  {
    conversationID,
    clientMsgIDList: [clientMsgID],
  },
]);

const targetMessage = result.findResultItems?.[0]?.messageList?.[0];

Parameters

Supply an array of query condition objects. Each entry defines a conversation-level lookup scope:

ParameterTypeRequiredDescription
conversationIDstringYesTarget conversation ID containing the messages.
clientMsgIDListstring[]YesArray of client message IDs to locate.

Return value

A resolved Promise returns a SearchMessageResult object, where matched messages reside in findResultItems:

  • Each entry in findResultItems contains the target conversationID and matching messageList: MessageItem[].
  • If an ID is not found locally or on the server, the corresponding item is omitted or returns an empty messageList.
  • For complete result structures and multi-criteria queries, see Search messages.