Get friends info
Retrieve detailed friendship profiles for specified friends using the OpenIM Flutter SDK.
Query detailed friendship profile cards for specified users in the currently signed-in user's friend list:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
userIDList | List<String> | Yes | List of target user IDs to query for friend information. |
filterBlack | bool | No | Whether to filter out blocked users. Pass true to omit blocked friends; pass false to include them. |
Code example
final friends = await OpenIM.iMManager.friendshipManager.getFriendsInfo(
userIDList: ['user_a', 'user_b'],
filterBlack: true,
);Return value
A successful Future returns a list of matching friend profiles (List<FriendInfo>).
Each FriendInfo object contains comprehensive relationship data, including userID, nickname, faceURL, custom remark remark, and extension string ex. The client should validate the nullable userID and update its local contacts cache using userID as the key. If an ID is absent from the returned list, the user is either not a friend or was excluded by the blocklist filter.
This query is a read-only operation and does not emit friendship listener events. To verify relationship status without pulling full profile cards, see Check friendship. To query public profiles for non-friend users, see Retrieve users.
Was this page helpful?