SDKsHarmonyOSEnterprise
Add conversations to groups
Associate one or more conversations with designated conversation groups.
This method only manages the association between conversations and groups; it does not create conversations or alter message destinations.
Code example
import sdk, { AddConversationsToGroupsReq } from '@openimsdk/imsdk';
const request: AddConversationsToGroupsReq = {
conversationIDs: [conversationID],
conversationGroupIDs: [conversationGroupID],
};
await sdk.addConversationsToGroups(request);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationIDs | string[] | Yes | List of conversation IDs to add. |
conversationGroupIDs | string[] | Yes | Target conversation group IDs. |
Return value
Returns a Promise that resolves to void when the association request is processed.
State changes after the call
Resolving the Promise confirms that the request was processed by the server; it does not guarantee that asynchronous group member events have arrived across all devices. When EventOnConversationGroupMemberAdded arrives, merge updates using conversationGroupID and conversationID. For listener registration, see Conversation groups overview. Re-query affected groups if you need authoritative reconciliation.
Was this page helpful?