addToBlackList

Introduction

Add users to blacklist, the list of users been blocked.

  1. The blocked users can not find they have been blocked by their friends, as they will not receive any error code after sending messages as default.

  2. Also, you can let the blocked users know that they have been blocked, by enable the 'Blocklist Check' here, while blocked users will receive error code of 20007 when sending messages.

Parameter details

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

Returned template

V2TimValueCallback<List<V2TimFriendOperationResult>>

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

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< V2TimFriendOperationResult > The list of operation result.

Code example

    V2TimValueCallback<List<V2TimFriendOperationResult>>
        addToBlackListRes = await TencentImSDKPlugin.v2TIMManager
            .getFriendshipManager()
            .addToBlackList(
              userIDList: [] 
              );
    if (addToBlackListRes.code == 0) {
      addToBlackListRes.data?.forEach((element) {
        element.resultCode;
        element.resultInfo;
        element.userID;
      });
    }

results matching ""

    No results matching ""