Browse SDKs · Flutter
Platform
SDKsFlutter

Get conversation ID

Compute a deterministic conversation ID by chat target using the OpenIM Flutter SDK.

Copy

When your application only needs a conversation identifier for routing or pre-queries, call this method to compute a standard conversationID instead of concatenating strings manually:

Parameters

ParameterTypeRequiredDescription
sourceIDStringYesTarget chat ID. Supply the counterparty's userID for single chat, or groupID for group chat.
sessionTypeintYesConversation type. Pass ConversationType.single for single chat, or ConversationType.superGroup for group chat.

Code example

final conversationID = await OpenIM.iMManager.conversationManager
    .getConversationIDBySessionType(
  sourceID: targetUserID,
  sessionType: ConversationType.single,
);

Return value

A successful Future returns the calculated standard conversationID string. This method computes the deterministic ID; it does not return the full ConversationInfo entity or emit conversation listener events.