Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Set group extension

Store application-defined custom metadata strings on a specific group.

Copy

The ex field stores an opaque string; the SDK does not automatically parse or merge nested JSON attributes. If multiple modules share this field, merge namespaced JSON properties in application memory before saving:

Code example

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

const request: SetGroupInfoReq = {
  groupID: groupID,
  ex: JSON.stringify({ projectID: 'project-42' }),
};
await sdk.setGroupInfo(request);

Parameters

ParameterTypeRequiredDescription
groupIDstringYesTarget group identifier.
exstringYesThe complete custom metadata string to assign.

Return value

Returns a Promise that resolves to void upon saving the metadata on the server.

State changes after the call

Resolving the Promise confirms that the extension string was saved. The SDK emits EventOnGroupInfoChanged; match the group by groupID and update its ex attribute in the local group cache, as detailed in Group overview.