Set group extension data
Store custom application metadata on a group using setGroupInfo().
Configure custom business extension metadata on a group. Populate the ex field on a GroupInfo instance to attach arbitrary business metadata (such as a JSON string holding project tags or department IDs). The server replaces the existing extension string in its entirety; provide the complete updated payload on each call.
Code example
GroupInfo update = new GroupInfo();
update.setGroupID("group_123");
update.setEx("{\"projectCode\":\"mobile\",\"archived\":false}");
OpenIMClient.getInstance().groupManager.setGroupInfo(
update,
new OnBase<String>() {
@Override
public void onSuccess(String data) {
// Group extension 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 ex extension string. |
base | OnBase<String> | Yes | Callback delivering the asynchronous operation result. |
Return value
The successful callback confirms that the extension string was persisted on the server.
State changes after the call
Once the extension string is saved, online group members receive the onGroupInfoChanged(GroupInfo group) event via OnGroupListener. Merge the updated ex field into your local group records using groupID. For complete listener registration details, see Group overview.
Was this page helpful?