Browse SDKs · iOS
Platform
SDKsiOSIncludes Enterprise features

Conversations overview

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

Copy

In the OpenIM architecture, a conversation encapsulates the local client state maintained for a direct 1-on-1 chat or group session, represented by an OIMConversationInfo object. It tracks list presentation states including unread counts, latest messages, pinned statuses, drafts, message reception preferences, and custom extension strings. Conversation records are identified separately from their underlying chat targets: conversationID identifies the authenticated user's personal conversation session, whereas direct chat targets use the recipient's userID and group chat targets use groupID.

Both direct and group chats maintain chat-list states via conversation records. Group metadata, member lists, and role permissions remain managed under the Group API domain. Group chat views consume groupID for group member capabilities, while utilizing conversationID for conversation settings, unread counts, drafts, and message history.

Conversation identifiers

Direct 1-on-1 conversations use the peer user ID as sourceID with conversation type OIMConversationTypeC2C. Group conversations use groupID as sourceID with conversation type OIMConversationTypeGroup. Invoke Generate a conversation ID to obtain a deterministic conversationID for conversation settings, read marks, hiding, and message clearance.

IdentifierPurpose
conversationIDPersonal conversation record ID for the signed-in account; routes settings, message history, and unread states.
userIDTarget peer user ID for direct 1-on-1 conversations.
groupIDTarget group ID for group chats, serving as the entity key for Group APIs.
sourceIDTarget entity ID used in type-based queries: userID for 1-on-1 chats, or groupID for group chats.

OIMConversationInfo properties

PropertyDescription
conversationIDUnique conversation identifier.
conversationTypeOIMConversationType enum indicating conversation category.
userID / groupIDTarget peer user ID or group ID for the conversation.
showName / faceURLResolved display name and avatar URL for UI rendering.
unreadCountUnread message count for this conversation.
latestMsg / latestMsgSendTimeLast message content preview and its send timestamp in milliseconds.
recvMsgOptOIMReceiveMessageOpt message reception and notification setting.
groupAtTypeOIMGroupAtType mention state (e.g., at-all, at-me).
draftText / draftTextTimeDraft message text and last update timestamp.
isPinnedWhether the conversation is pinned to the top of the chat list.
isPrivateChatEnterprise / burnDuration EnterpriseBurn-after-reading private chat toggle and countdown duration in seconds.
isMsgDestructEnterprise / msgDestructTime EnterpriseScheduled server message deletion toggle and destruction cycle.
isNotInGroupWhether the current user has left or been removed from the group.
attachedInfoReserved SDK metadata string.
exCustom application-defined extension string.

Feature navigation

Conversation lifecycle

Conversation groups

Conversation groups overview explains how to classify conversations into user-defined folders. Members are referenced by conversationID, while the group itself uses conversationGroupID. Conversation grouping reorganizes personal chat presentation without creating group chats or altering groupID, group metadata, or membership.

The iOS SDK exposes conversation grouping through OpenIMCore JSON interfaces bundled with the SDK and tracks updates via a single conversation group listener. Query calls return current category snapshots. Group updates merge by conversationGroupID, and member associations merge by conversationGroupID and conversationID.

State synchronization

Query APIs establish initial data snapshots, while delegate methods merge subsequent changes:

Treat API completion callbacks, asynchronous delegate events, and reconciliation queries as distinct operational phases. Never assume remote multi-terminal synchronization has completed solely because a local write callback returned successfully.