createForwardMessage

Introduction

Create a forward message.

For details, you can referring to this document.

Parameter details

Parameter name Parameter type Required Description
msgID string yes The message ID of the original message.
webMessageInstance string no The message instance of the original message on Web.

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 forwarding message created.

Code example

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


const createForwardMessageRes = await TencentImSDKPlugin.v2TIMManager
    .getMessageManager()
    .createForwardMessage(

        'msgid'
    );
if (createForwardMessageRes.code === 0) {

    const id = createForwardMessageRes.data!.id!;




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

    }
}

results matching ""

    No results matching ""