SDKsReact Native
Open a conversation
Query a conversation by its chat target and session type.
Call getOneConversation() to query a conversation by its chat target and session type.
const conversation = await OpenIMSDK.getOneConversation({
sourceID: targetUserID,
sessionType: SessionType.Single,
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sourceID | string | Yes | Pass the other user's ID for a one-to-one conversation or the group ID for a group conversation. |
sessionType | SessionType | Yes | Conversation type. Use SessionType.Single for one-to-one conversations and SessionType.Group for group conversations. |
Return result
The call returns a ConversationItem. See Retrieve the conversation list for conversation fields.
Was this page helpful?