SDKsAndroid
Get group member profiles
Use getGroupMembersInfo to retrieve specified users’ profiles within a group.
Retrieve detailed member profiles for specific users within a given group (including in-group nickname, role level, and mute status). Pass the target group ID and a list of user IDs. This method is commonly used for message bubble rendering, member profile cards, and mention parsing.
Code example
String groupID = "group_123";
List<String> userIDs = Arrays.asList("user_a", "user_b");
OpenIMClient.getInstance().groupManager.getGroupMembersInfo(
new OnBase<List<GroupMembersInfo>>() {
@Override
public void onSuccess(List<GroupMembersInfo> members) {
// members contains the retrieved group member profiles
}
@Override
public void onError(int code, String error) {
// Failed to retrieve member profiles
}
},
groupID,
userIDs
);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
base | OnBase<List<GroupMembersInfo>> | Yes | Callback handler for the asynchronous request. |
groupID | String | Yes | Globally unique ID of the target group. |
userIDs | List<String> | Yes | List of user IDs whose member profiles are being queried. |
Return value
Upon success, onSuccess returns a list of member profiles (List<GroupMembersInfo>). Each entry contains member attributes such as nickname, faceURL, roleLevel, and muteEndTime.
State changes after the call
- Snapshot retrieval: This is a read-only query that retrieves the specified member records without mutating group state.
- Local cache update: The client should merge the returned items into the local member cache using
groupID:userIDas the unique key. - Modifications: To update a member's in-group information, see Set group member nickname.
Was this page helpful?