checkFriend

Introduction

Check the relationship between current user and specific users.

Parameter details

Parameter name Parameter type Required Description
userIDList string[] yes The list of users that needs checking.
checkType FriendType yes The type of checking.

Returned template

V2TimValueCallback<V2TimFriendCheckResult[]>

{
    code : number
    desc : string
    data : V2TimFriendCheckResult[]
}

Return value details

name type description
code number Request result: Error codes. 0 means success.
desc string The description of the error. It will be empty if success.
data V2TimFriendCheckResult[] The list of checking results.

Code example

import { TencentImSDKPlugin, FriendType } from 'react-native-tim-js';


const checkFriendRes = await TencentImSDKPlugin.v2TIMManager
    .getFriendshipManager()
    .checkFriend(
        [],
        FriendType.V2TIM_FRIEND_TYPE_BOTH
    );
if (checkFriendRes.code == 0) {

    checkFriendRes.data?.forEach((element) => {
        element.resultCode;
        element.resultInfo;
        element.resultType;
        element.userID;
    });
}

results matching ""

    No results matching ""