Set group announcement
Publish or update announcement text for a specific group using setGroupInfo().
Publish or update the announcement text for a specific group. Assign the target groupID and the updated notification string in the GroupInfo object. Once persisted, the server automatically updates the announcement author ID and timestamp.
Code example
GroupInfo update = new GroupInfo();
update.setGroupID("group_123");
update.setNotification("Release deployment confirmation tonight at 20:00.");
OpenIMClient.getInstance().groupManager.setGroupInfo(
update,
new OnBase<String>() {
@Override
public void onSuccess(String data) {
// Group announcement updated successfully
}
@Override
public void onError(int code, String error) {
// Handle update failure
}
}
);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupInfo | GroupInfo | Yes | Group entity holding the target groupID and the updated notification text. |
base | OnBase<String> | Yes | Callback delivering the asynchronous operation result. |
Return value
The successful callback confirms that the announcement was persisted on the server.
State changes after the call
After the announcement is updated, online group members receive the onGroupInfoChanged(GroupInfo group) event via OnGroupListener. The updated GroupInfo payload contains the new notification text, notificationUpdateTime, and notificationUserID. Merge these properties into your local cache using groupID. For complete listener registration details, see Group overview.
Was this page helpful?