SDKsAndroid
Set group member extra data
Store application-defined group member data in SetGroupMemberInfo.ex.
Store custom business extension attributes on a group member record. By setting the ex string field (typically a JSON string) on SetGroupMemberInfo, you can store application-specific metadata (such as internal duties, points, or custom tags). The server replaces the existing string entirely.
Code example
SetGroupMemberInfo update = new SetGroupMemberInfo();
update.setGroupID("group_123");
update.setUserID("user_a");
update.setEx("{\"duty\":\"reviewer\",\"tag\":\"expert\"}");
OpenIMClient.getInstance().groupManager.setGroupMemberInfo(
update,
new OnBase<String>() {
@Override
public void onSuccess(String data) {
// Group member extra data updated successfully
}
@Override
public void onError(int code, String error) {
// Failed to update group member extra data
}
}
);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupMemberInfo | SetGroupMemberInfo | Yes | Member update object. Must specify groupID, member userID, and the new extension string ex. |
base | OnBase<String> | Yes | Callback handler for the asynchronous request. |
Return value
Upon success, data in onSuccess returns a confirmation message.
State changes after the call
- Callback confirmation: The
onSuccesscallback indicates that the extension data was saved to the server. - Asynchronous event delivery: Group members receive the
onGroupMemberInfoChangedevent delivering the updatedGroupMembersInfo. The client should merge the updatedexpayload into the local member cache usinggroupID:userIDas the unique key. - Re-query calibration: If member extension data diverges, call Get group member profiles to refresh data from the server.
For complete listener registration and lifecycle management, see Group overview.
Was this page helpful?