createMergerMessage

Introduction

Create a merger message.

You can merge and forward messages as provided by WeChat in the following steps:

  1. Create a merged message based on the list of original messages.

  2. Send the merged message to the receiver.

  3. The receiver receives the merged message and parses the list of original messages.

For details, you can referring to this document.

Parameter details

Parameter name Parameter type Required Description
msgIDList string[] yes List of IDs of original messages to be merged and forwarded
title string yes Title of the merged message, such as "Chat History of Trump and Biden" as shown above
abstractList string[] yes The abstract list of the merged message as shown above. The original message digests need to be displayed for the merged message, which will be unfolded after the user clicks the cell.
compatibleText string yes If the early SDK version does not support the merged message, the user will receive a text message with the content compatibleText by default.

Returned template

V2TimValueCallback<V2TimMsgCreateInfoResult>

{
    code: number,
    desc: string,
    data: {
        id: string,
        messageInfo: V2TimMessage,
    }
}

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 V2TimMsgCreateInfoResult The description of the error. It will be empty if success.

Code example

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


const createMergerMessageResult = await TencentImSDKPlugin.v2TIMManager
    .getMessageManager()
    .createMergerMessage(

        ['msgid1', 'msgid2'],
        'user1与user2的聊天',
        ['user1:hello', 'user2:你好'],
        '当前版本不支持该消息'
    );
if (createMergerMessageResult.code === 0) {




    TencentImSDKPlugin.v2TIMManager.getMessageManager().sendMessage({
        id: createMergerMessageResult.data!.id!,
        receiver: 'receiver',
        groupID: 'groupID',
    });
}

results matching ""

    No results matching ""