Browse SDKs · React Native
SDKsReact Native

Resolve a conversation ID

Generate a conversation ID from a chat target and session type.

Copy

Call getConversationIDBySessionType() to generate a conversation ID from a chat target and session type.

const conversationID = await OpenIMSDK.getConversationIDBySessionType({
  sourceID: targetUserID,
  sessionType: SessionType.Single,
});

Parameters

ParameterTypeRequiredDescription
sourceIDstringYesPass the other user's ID for a one-to-one conversation or the group ID for a group conversation.
sessionTypeSessionTypeYesConversation type. Use SessionType.Single for one-to-one conversations and SessionType.Group for group conversations.

Return result

The call returns the conversation ID as a string.