getFriendsInfo
Introduction
Get the profile information of the specific friends.
You can get the relationship type from the
relation
in result.It is recommended to request for 100 users once, to avoid the risk of refusing from IM Server, which has a limit to inbound request package size in 1MB.
Parameter details
Parameter name | Parameter type | Required | Platform | Description |
---|---|---|---|---|
userIDList | List< String > | yes | All | The list of ID of the users to request. |
Returned template
V2TimValueCallback<List<V2TimFriendInfoResult>>
{
code : int
desc : String
data : List<V2TimFriendInfoResult>
}
Return value details
name | type | description |
---|---|---|
code | int | Request result: Error codes. 0 means success. |
desc | String | The description of the error. It will be empty if success. |
data | List< V2TimFriendInfoResult > | The list of result. |
Code example
V2TimValueCallback<List<V2TimFriendInfoResult>> getFriendsInfoRes =
await TencentImSDKPlugin.v2TIMManager
.getFriendshipManager()
.getFriendsInfo(userIDList: []);
if (getFriendsInfoRes.code == 0) {
getFriendsInfoRes.data?.forEach((element) {
element.relation;
element.resultCode;
element.resultInfo;
element.friendInfo?.friendCustomInfo;
element.friendInfo?.friendGroups;
element.friendInfo?.friendRemark;
element.friendInfo?.userID;
element.friendInfo?.userProfile?.allowType;
element.friendInfo?.userProfile?.birthday;
element.friendInfo?.userProfile?.customInfo;
element.friendInfo?.userProfile?.faceUrl;
element.friendInfo?.userProfile?.gender;
element.friendInfo?.userProfile?.level;
element.friendInfo?.userProfile?.nickName;
element.friendInfo?.userProfile?.role;
element.friendInfo?.userProfile?.selfSignature;
element.friendInfo?.userProfile?.userID;
});
}