getMessageManager

Introduction

Get the message manager, which is the main class for those message-related methods.

Get the message manager, which is the main class for those message-related methods.

Parameter details

This API has no parameters

Returned template

V2TIMMessageManager

Return value details

name type description
V2TIMMessageManager V2TIMMessageManager The message manager, which is the main class for those message-related methods.

Code example

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



const textMessage = 'test';

const createTextMessageRes = await TencentImSDKPlugin.v2TIMManager
    .getMessageManager()
    .createTextMessage(textMessage);
if (createTextMessageRes.code === 0) {

    const id = createTextMessageRes.data?.id;




    const sendMessageRes = await TencentImSDKPlugin.v2TIMManager
        .getMessageManager()
        .sendMessage({ id: id!, receiver: 'userID', groupID: 'groupID' });
    if (sendMessageRes.code === 0) {

    }
}

results matching ""

    No results matching ""