Browse SDKs · React Native
SDKsReact Native

Find messages by ID

OpenIM React Native SDK guide for find messages by id.

Copy

Use findMessageList() to find messages by conversation ID and message ID. It is useful when navigating to a known message from a search result, quote, or notification.

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

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

Parameters

findMessageList() receives an array of query conditions. Each item contains:

ParameterTypeRequiredDescription
conversationIDstringYesConversation containing the target messages.
clientMsgIDListstring[]YesMessage IDs to find.

Return value

The call returns SearchMessageResult; ID-based results are in findResultItems. Each result item contains conversationID and messageList. A missing message may produce an empty result item or message list. See Search messages for the complete result structure.