getFriendList

Introduction

Load the list of friend or contacts.

Parameter details

This API has no parameters

Returned template

V2TimValueCallback<List<V2TimFriendInfo>>

{
    code : int
    desc : String
    data : List<V2TimFriendInfo>
}

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< V2TimFriendInfo > The list of friends and contacts.

Code example

    V2TimValueCallback<List<V2TimFriendInfo>> getFriendListRes =
        await TencentImSDKPlugin.v2TIMManager
            .getFriendshipManager()
            .getFriendList();
    if (getFriendListRes.code == 0) {
      getFriendListRes.data?.forEach((element) { 
        element.friendCustomInfo;
        element.friendGroups;
        element.friendRemark;
        element.userID;
        element.userProfile?.allowType;
        element.userProfile?.birthday;
        element.userProfile?.customInfo;
        element.userProfile?.faceUrl;
        element.userProfile?.gender;
        element.userProfile?.level;
        element.userProfile?.nickName;
        element.userProfile?.role;
        element.userProfile?.selfSignature;
        element.userProfile?.userID;
      });
    }

results matching ""

    No results matching ""