addConversationListener

Introduction

Add conversation listener

  1. You can receive the changing events of conversation list, after adding a conversation listener.

  2. Adding a conversation listener by addConversationListener.

Parameter details

Parameter name Parameter type Required Description
listener V2TimConversationListener yes The conversation listener to add.

Returned template

void

Return value details

This function has no return value

Code example

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


const listener: V2TimConversationListener = {
    onSyncServerStart: () => {

    },
    onSyncServerFinish: () => {

    },
    onSyncServerFailed: () => {

    },
    onNewConversation: (conversationList) => {


    },
    onTotalUnreadMessageCountChanged: (totalUnreadCount) => {


    },
    onConversationChanged: (conversationList) => {


    },
    onConversationGroupCreated(groupName, conversationList) {

    },
    onConversationGroupDeleted(groupName) {

    },
    onConversationGroupNameChanged(oldName, newName) {

    },
    onConversationsAddedToGroup(groupName, conversationList) {

    },
    onConversationsDeletedFromGroup(groupName, conversationList) {

    },
};

TencentImSDKPlugin.v2TIMManager
    .getConversationManager()
    .addConversationListener(listener);

results matching ""

    No results matching ""