getUsersInfo

Introduction

Get the info or profile of users.

Specified the self User to load the data of self.

Also you can query the users, regardless if friends, with this method.

This method supports batch requests, but have better no more than 100, to avoid the rejection of the IM server, as the request package exceed 1M.

Parameter details

Parameter name Parameter type Required Platform Description
userIDList List< String > yes All The list of users to query.

Returned template

V2TimValueCallback<List<V2TimUserFullInfo>>

{
    code : int
    desc : String
    data : List<V2TimUserFullInfo>// The list of results.
}

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< V2TimUserFullInfo > The list of results.

Code example

    final CoreServicesImpl coreInstance = TIMUIKitCore.getInstance();
    V2TimValueCallback<List<V2TimUserFullInfo>> getUsersInfoRes =
        await coreInstance.getUsersInfo(userIDList: []);
    if (getUsersInfoRes.code == 0) {
      getUsersInfoRes.data?.forEach((element) {
        element.allowType; 
        element.birthday; 
        element.customInfo; 
        element.faceUrl;
        element.gender; 
        element.level; 
        element.nickName; 
        element.role; 
        element.selfSignature; 
        element.userID; 
      });
    }

results matching ""

    No results matching ""