Browse SDKs · iOS
SDKsiOS

Conversations overview

Understand the responsibilities of OIMConversationInfo, conversationID, conversation settings, and conversation events in OpenIM iOS SDK.

Copy

In OpenIMSDK, a conversation is the client-side chat state maintained for a one-to-one or group chat. One OIMConversationInfo record represents that state for the signed-in user. It stores list-related state such as the unread count, latest message, pinned status, draft, message-reception option, and extension field. A conversation record and its chat target have separate identifiers: conversationID locates the current account's conversation state, while a one-to-one target uses the other user's userID and a group-chat target uses its groupID.

Both one-to-one and group chats use conversation records for chat-list state. Group profiles, membership, and permissions remain under the Group APIs. A group-chat page therefore uses groupID for group capabilities and conversationID for conversation settings, unread counts, drafts, and message history.

Conversation identifiers

For a one-to-one conversation, sourceID is the target user's ID and the conversation type is OIMConversationTypeC2C. For a group conversation, sourceID is the groupID and the conversation type is OIMConversationTypeGroup. Call getConversationIDBySessionType:sourceID: to obtain a stable conversationID, then use it for conversation settings, read status, hiding, and message cleanup.

IdentifierPurpose
conversationIDThe current account's conversation-record ID, used for conversation settings, message history, and unread state.
userIDThe other user's ID in a one-to-one chat.
groupIDThe group ID for a group chat and the target identifier used by Group APIs.
sourceIDThe chat-target ID used in a type-based lookup: userID for a one-to-one chat or groupID for a group chat.

OIMConversationInfo

PropertyDescription
conversationIDThe conversation ID.
conversationTypeThe OIMConversationType value.
userID / groupIDThe user or group identifier for the chat.
showName / faceURLThe conversation's current display name and avatar.
unreadCountThe current unread count for the conversation.
latestMsg / latestMsgSendTimeThe latest message and its send time.
recvMsgOptThe OIMReceiveMessageOpt message-reception option.
groupAtTypeThe OIMGroupAtType group-mention state.
draftText / draftTextTimeThe draft and its last update time.
isPinnedWhether the conversation is pinned.
isPrivateChat / burnDurationThe private-chat state and burn-after-reading duration.
isNotInGroupWhether the current user is no longer in the group.
attachedInfoAdditional SDK information.
exA conversation extension string whose format is defined by your application.

Queries and settings

Conversation lifecycle

Conversation groups

Conversation groups overview explains how to organize conversations into custom groups. A group member is identified by conversationID, while the group itself uses conversationGroupID. This organization affects only the current account's conversation list. It does not create a chat group or change its groupID, profile, or membership.

The iOS enterprise SDK exposes this capability through the OpenIMCore JSON interface bundled with the SDK and merges incremental updates through one conversation-group listener. Query results establish group snapshots. Group events update records by conversationGroupID, while membership events use conversationGroupID + conversationID. The overview describes these data boundaries, provides the complete listener setup, and links to every individual API page.

State updates

Queries establish page snapshots, and delegates merge subsequent changes:

This overview identifies event ownership without registering delegates again. Handle an operation's success callback, delegate updates, and reconciliation queries separately. Do not infer final conversation state solely from the action the user initiated.