Conversation overview
Learn about conversations, conversation state, and conversation groups in the OpenIM React Native SDK.
In the OpenIM React Native SDK, a conversation is a chat state maintained by the current account. Both one-to-one and group chats correspond to a ConversationItem, which contains list presentation data, unread state, drafts, and message reception settings.
Conversation records and chat targets use different identifiers. conversationID identifies the current account's conversation record, while a one-to-one target uses the other user's userID and a group target uses groupID. Group profiles, members, and permissions are managed through group APIs.
Conversation identifiers
| Identifier | Meaning |
|---|---|
conversationID | Conversation record ID for the current account. |
userID | The other user's ID in a one-to-one conversation. |
groupID | Group ID for a group conversation. |
sourceID | Chat target used when querying by type: pass userID for one-to-one conversations or groupID for group conversations. |
To generate a conversationID from a chat target, call Resolve a conversation ID with sourceID and sessionType.
Conversation data
ConversationItem contains list presentation data and settings for the current account:
| Category | Fields | Description |
|---|---|---|
| Identity and type | conversationID, conversationType | Identify the conversation record and distinguish one-to-one and group conversations. |
| List presentation | showName, faceURL, latestMsg, latestMsgSendTime | Display the conversation name, avatar, and latest message. |
| Unread and mentions | unreadCount, groupAtType | Display unread counts and group mention status. |
| List organization | isPinned, isMarked, draftText, remark | Manage pinning, marking, drafts, and the current account's remark. |
| Message policies | recvMsgOpt, isPrivateChat, burnDuration, isMsgDestruct, msgDestructTime | Configure message reception, burn after reading, and server-side deletion. |
| Other state and extensions | isNotInGroup, attachedInfo, ex | Indicate group membership state, SDK-attached information, and application extensions. |
Find a page by task
| Task | Related page |
|---|---|
| Get one or more conversations | Open a conversation, Get conversations by ID, Retrieve the conversation list |
| Organize the conversation list | Pin or unpin a conversation, Mark or unmark a conversation, Conversation group overview |
| Manage drafts, remarks, and extensions | Set a conversation draft, Set a conversation remark, Set conversation extra data |
| Configure message reception and retention | Set conversation message reception, Enable or disable burn after reading, Schedule server message deletion |
| Handle unread counts and group mentions | Mark a conversation as read, Track the total unread count, Reset group mention status |
Hide, delete, and clear
These operations have different scopes:
| Operation | Effect |
|---|---|
| Hide a conversation | Hide one conversation from the current account's list; it may reappear when a new message arrives. |
| Delete a conversation and its messages | Delete the conversation record and the current account's messages in it. |
| Clear messages in a conversation | Keep the conversation record and clear only the current account's messages. |
Events
Conversation state changes are delivered through events:
- Retrieve the conversation list covers new conversations and conversation-field changes.
- Track the total unread count covers total unread-count changes.
- Conversation group overview covers conversation-group and membership changes.
Was this page helpful?