createForwardMessage
Introduction
Create a forwarding message for a single message.
For details, you can referring to this document.
Parameter details
Parameter name | Parameter type | Required | Platform | Description |
---|---|---|---|---|
msgID | String | yes | All | The message ID of the original message. |
webMessageInstance | String | no | All | The message instance of the original message on Web. |
Returned template
V2TimValueCallback<V2TimMsgCreateInfoResult>
{
code: int,
desc: String,
data: {
id: String,
messageInfo: V2TimMessage,
}
}
Return value details
name | type | description |
---|---|---|
code | int | Request result: Error codes. 0 means success. |
desc | String | The description of the failure. |
data | V2TimMsgCreateInfoResult | The forwarding message created. |
Code example
V2TimValueCallback<V2TimMsgCreateInfoResult> createForwardMessageRes =
await TencentImSDKPlugin.v2TIMManager
.getMessageManager()
.createForwardMessage(
msgID: "msgid",
webMessageInstance:"",
);
if (createForwardMessageRes.code == 0) {
String id = createForwardMessageRes.data!.id!;
V2TimValueCallback<V2TimMessage> sendMessageRes = await TencentImSDKPlugin
.v2TIMManager
.getMessageManager()
.sendMessage(id: id, receiver: "userID", groupID: "groupID");
if (sendMessageRes.code == 0) {
}
}