addFriendListener

Introduction

Add a friend listener.

  1. Users can receive the following relationship information changes events, only after add a friend listener.

  2. Invoking this method will add a friend listener to current friend listeners array.

Parameter details

Parameter name Parameter type Required Description
listener V2TimFriendshipListener yes The listener to be added.

Returned template

void

Return value details

This function has no return value

Code example

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


const listener: V2TimFriendshipListener = {
    onBlackListAdd: (infoList) => {


    },
    onBlackListDeleted: (userList) => {


    },
    onFriendApplicationListAdded: (applicationList) => {


    },
    onFriendApplicationListDeleted: (userIDList) => {


    },
    onFriendApplicationListRead: () => {

    },
    onFriendInfoChanged: (infoList) => {


    },
    onFriendListAdded: (users) => {


    },
    onFriendListDeleted: (userList) => {


    },
};
TencentImSDKPlugin.v2TIMManager
    .getFriendshipManager()
    .addFriendListener(listener);

results matching ""

    No results matching ""