SDKsHarmonyOSEnterprise
Publish or update group announcement
Publish, modify, or clear group announcement notices.
The notification field contains the public group announcement, separate from the group's introduction description. Permissions are verified on the server; display editing controls according to the user's role level:
Code example
import sdk, { SetGroupInfoReq } from '@openimsdk/imsdk';
const request: SetGroupInfoReq = {
groupID: groupID,
notification: announcement.trim(),
};
await sdk.setGroupInfo(request);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | Target group identifier. |
notification | string | Yes | Announcement text. Pass an empty string to clear the announcement. |
Return value
Returns a Promise that resolves to void upon updating the announcement.
State changes after the call
Resolving the Promise confirms that the announcement was saved on the server. The SDK emits EventOnGroupInfoChanged; match the group by groupID and update its notification property in the UI, as detailed in Group overview.
Was this page helpful?