Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Remove conversations from groups

Remove one or more conversations from designated conversation groups.

Copy

This method unlinks conversations from conversation groups; it does not delete the conversations or clear chat history.

Code example

import sdk, { RemoveConversationsFromGroupsReq } from '@openimsdk/imsdk';

const request: RemoveConversationsFromGroupsReq = {
  conversationIDs: [conversationID],
  conversationGroupIDs: [conversationGroupID],
};
await sdk.removeConversationsFromGroups(request);

Parameters

ParameterTypeRequiredDescription
conversationIDsstring[]YesList of conversation IDs to unlink.
conversationGroupIDsstring[]YesTarget conversation group IDs.

Return value

Returns a Promise that resolves to void when the dissociation request completes.

State changes after the call

Resolving the Promise confirms that the unlinking instruction succeeded on the server. Update local state incrementally when receiving EventOnConversationGroupMemberDeleted, correlating by conversationGroupID and conversationID. For detailed event patterns, see Conversation groups overview. Re-query affected groups to calibrate state when necessary.