Create a custom message.

For details, you can referring to this document.

Parameter details

Parameter name Parameter type Required Platform Description
data String yes All The custom data of the message.
desc String no All The custom description of the message.
extension String no All The custom extension of the message.

Returned template


    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 created custom message on local.

Code example

    V2TimValueCallback<V2TimMsgCreateInfoResult> createCustomMessageRes =
        await TencentImSDKPlugin.v2TIMManager
              data: 'The data of the message.',
              desc: 'The description of the message.',
              extension: 'The extension of the message.',
    if (createCustomMessageRes.code == 0) {
      String? id =;
      V2TimValueCallback<V2TimMessage> sendMessageRes = await TencentImSDKPlugin
          .sendMessage(id: id!, receiver: "userID", groupID: "groupID");
      if (sendMessageRes.code == 0) {;;; 

results matching ""

    No results matching ""