Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Update group profile

Modify a group’s display name, introduction summary, and avatar URL.

Copy

Update basic group attributes from a profile editing form. Include only fields that have changed, and provide at least one mutable field alongside groupID. Do not mix announcements, join verification rules, or permission flags into this general profile update:

Code example

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

const request: SetGroupInfoReq = {
  groupID: groupID,
  groupName: groupName.trim(),
  introduction: introduction.trim(),
  faceURL: faceURL,
};
await sdk.setGroupInfo(request);

Parameters

ParameterTypeRequiredDescription
groupIDstringYesTarget group identifier.
groupNamestringNoNew group display name.
introductionstringNoNew group introduction text.
faceURLstringNoNew group avatar image URL.

Return value

Returns a Promise that resolves to void upon updating the group on the server.

State changes after the call

Resolving the Promise confirms that the server accepted the updates; it does not mean that the group change event has reached every member device yet. When EventOnGroupInfoChanged arrives, update local group state keyed by groupID. For event listener patterns, see Group overview. To fetch authoritative data immediately, call Retrieve specified group profiles.