SDKsFlutter
Get conversation ID
Compute a deterministic conversation ID by chat target using the OpenIM Flutter SDK.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
sourceID | String | Yes | Target chat ID. Supply the counterparty's userID for single chat, or groupID for group chat. |
sessionType | int | Yes | Conversation 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.
Was this page helpful?