Browse SDKs · React Native
SDKsReact Native

Conversation overview

Learn about conversations, conversation state, and conversation groups in the OpenIM React Native SDK.

Copy

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

IdentifierMeaning
conversationIDConversation record ID for the current account.
userIDThe other user's ID in a one-to-one conversation.
groupIDGroup ID for a group conversation.
sourceIDChat 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:

CategoryFieldsDescription
Identity and typeconversationID, conversationTypeIdentify the conversation record and distinguish one-to-one and group conversations.
List presentationshowName, faceURL, latestMsg, latestMsgSendTimeDisplay the conversation name, avatar, and latest message.
Unread and mentionsunreadCount, groupAtTypeDisplay unread counts and group mention status.
List organizationisPinned, isMarked, draftText, remarkManage pinning, marking, drafts, and the current account's remark.
Message policiesrecvMsgOpt, isPrivateChat, burnDuration, isMsgDestruct, msgDestructTimeConfigure message reception, burn after reading, and server-side deletion.
Other state and extensionsisNotInGroup, attachedInfo, exIndicate group membership state, SDK-attached information, and application extensions.

Find a page by task

Hide, delete, and clear

These operations have different scopes:

OperationEffect
Hide a conversationHide one conversation from the current account's list; it may reappear when a new message arrives.
Delete a conversation and its messagesDelete the conversation record and the current account's messages in it.
Clear messages in a conversationKeep the conversation record and clear only the current account's messages.

Events

Conversation state changes are delivered through events: