sendMessage method

Future<V2TimValueCallback<V2TimMessage>?> sendMessage({
  1. required V2TimMsgCreateInfoResult createdMessage,
  2. String? groupID,
  3. String? userID,
  4. String? topicID,
  5. V2TimMessage? repliedMessage,
  6. V2TimGroupInfo? groupInfo,
  7. OfflinePushInfo? offlinePushInfo,
  8. bool? needReadReceipt,
  9. @Deprecated("This config is for internal use only in the UIKit and should not be specified manually.") TencentCloudChatMessageConfig? config,
  10. @Deprecated("This hook is for internal use only in the UIKit and should not be specified manually.") BeforeMessageSending? beforeMessageSendingHook,
  11. bool? isResend = false,
})

Sends a message and adds it to the message list UI. Before sending, use the Chat SDK create message method to create a message instance, and pass the created instance through the createdMessage parameter. The repliedMessage parameter indicates whether this message is a reply to a previous message. Other parameters are used to configure the offline push configuration for the recipient, whether a read receipt is needed, and other features. The userID, groupID and topicID parameters identify the target conversation.

Implementation

Future<V2TimValueCallback<V2TimMessage>?> sendMessage({
  required V2TimMsgCreateInfoResult createdMessage,
  String? groupID,
  String? userID,
  String? topicID,
  V2TimMessage? repliedMessage,
  V2TimGroupInfo? groupInfo,
  OfflinePushInfo? offlinePushInfo,
  bool? needReadReceipt,
  @Deprecated("This config is for internal use only in the UIKit and should not be specified manually.")
  TencentCloudChatMessageConfig? config,
  @Deprecated("This hook is for internal use only in the UIKit and should not be specified manually.")
  BeforeMessageSending? beforeMessageSendingHook,
  bool? isResend = false,
}) async {
  return TencentCloudChatMessageDataTools.sendMessage(
    createdMessage: createdMessage,
    groupInfo: groupInfo,
    userID: userID,
    topicID: topicID,
    groupID: TencentCloudChatUtils.checkString(topicID) ?? groupID,
    repliedMessage: repliedMessage,
    offlinePushInfo: offlinePushInfo,
    needReadReceipt: needReadReceipt,
    config: config,
    beforeMessageSendingHook: beforeMessageSendingHook,
    isResend: isResend,
  );
}