Browse SDKs · Android
Platform
SDKsAndroid

Set group member extra data

Store application-defined group member data in SetGroupMemberInfo.ex.

Copy

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

ParameterTypeRequiredDescription
groupMemberInfoSetGroupMemberInfoYesMember update object. Must specify groupID, member userID, and the new extension string ex.
baseOnBase<String>YesCallback handler for the asynchronous request.

Return value

Upon success, data in onSuccess returns a confirmation message.

State changes after the call

  1. Callback confirmation: The onSuccess callback indicates that the extension data was saved to the server.
  2. Asynchronous event delivery: Group members receive the onGroupMemberInfoChanged event delivering the updated GroupMembersInfo. The client should merge the updated ex payload into the local member cache using groupID:userID as the unique key.
  3. 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.