Browse SDKs · React Native
Platform
SDKsReact NativeEnterprise

Create a conversation group

Create a new conversation categorization group for the current account using the OpenIM React Native SDK.

Copy

Create a new conversation group for the authenticated account. Supply at least name when creating a custom group, and optionally specify an initial conversation to associate:

const group = await OpenIMSDK.createConversationGroup({
  name: 'Work',
  order: 100,
  conversationID,
  conversationGroupType: ConversationGroupType.ConversationGroupTypeNormal,
});

Parameters

ParameterTypeRequiredDescription
namestringYesName of the conversation group.
ordernumberNoOrdering priority value for list sorting.
exstringNoCustom extension string for this group.
conversationIDstringNoInitial conversation ID to add to the group upon creation.
conversationGroupTypeConversationGroupTypeNoGroup type: pass ConversationGroupTypeNormal for custom groups.

Return value

Resolves to a ConversationGroupResp object containing conversationGroupID, name, order, and conversationIDs.

Creation triggers the OnConversationGroupAdded event. Use conversationGroupID as the primary key to insert or reconcile the group in local state, and use conversationID to manage member conversations inside the group. For event registration, see Conversation groups overview.