SDKsHarmonyOSEnterprise
Update conversation group
Modify the display name, custom metadata, or hidden state of a conversation group.
Specify the target group via conversationGroupID. Include only the fields you wish to update, providing at least one mutable property.
Code example
import sdk, { UpdateConversationGroupReq, UpdateConversationGroupResp } from '@openimsdk/imsdk';
const request: UpdateConversationGroupReq = {
conversationGroupID: conversationGroupID,
name: 'Priority Work',
hidden: false,
};
const response: UpdateConversationGroupResp = await sdk.updateConversationGroup(request);
const updatedGroup = response.conversationGroup;Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationGroupID | string | Yes | Target conversation group identifier. |
name | string | No | New group display name. |
ex | string | No | Updated complete metadata string. |
hidden | boolean | No | Whether to hide this group from the interface. |
Return value
Returns a Promise that resolves to an UpdateConversationGroupResp object:
| Property | Type | Description |
|---|---|---|
conversationGroup | IMConversationGroup | The updated conversation group record. |
State changes after the call
Upon Promise resolution, update your local view by matching the returned group on conversationGroupID. The server broadcasts updates to other devices via EventOnConversationGroupChanged. For complete event handling and cleanup patterns, see Conversation groups overview.
Was this page helpful?