SDKsReact Native
Get conversation by target
Retrieve a single conversation item by target ID and session type using the OpenIM React Native SDK.
Retrieve the conversation details for a specific chat recipient or group using getOneConversation():
const conversation = await OpenIMSDK.getOneConversation({
sourceID: targetUserID,
sessionType: SessionType.Single,
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sourceID | string | Yes | Target identifier: user ID for direct 1-on-1 chats, or group ID for group chats. |
sessionType | SessionType | Yes | Conversation session type: SessionType.Single for direct chats, or SessionType.Group for group chats. |
Return value
Resolves to the matching ConversationItem object.
This query retrieves a local snapshot and does not trigger conversation events. Subsequent state updates arrive asynchronously via event listeners as described in Conversation overview; for field details, see Retrieve conversation list.
Was this page helpful?