sendMessage abstract method

Future<ZIMMessageSentResult> sendMessage(
  1. ZIMMessage message,
  2. String toConversationID,
  3. ZIMConversationType conversationType,
  4. ZIMMessageSendConfig config, [
  5. ZIMMessageSendNotification? notification,
])

send message.

Available since: 2.4.0 and above. Description: This method can be used to send messages in single chat, room and group chat. Use cases: When you need to send message to the target user, target message room, and target group chat after logging in, send it through this interface. When to call: It can be called after login. Restrictions: The interval between sending messages should be greater than 100ms. Available after login, unavailable after logout. Related callbacks: ZIMMessageSentResult, ZIMMessageSendNotification, onPeerMessageReceived, onRoomMessageReceived, onGroupMessageReceived, onConversationChanged, onConversationTotalUnreadMessageCountUpdated. Related APIs: queryHistoryMessage, deleteAllMessage, deleteMessages,sendMediaMessage.

  • message The message to be sent.
  • toConversationID The conversation ID the message needs to be sent.
  • conversationType The conversation type the message needs to be sent.
  • config Related configuration for sending messages.
  • notification Related notifications when messages are sent.

Implementation

Future<ZIMMessageSentResult> sendMessage(
  ZIMMessage message,
  String toConversationID,
  ZIMConversationType conversationType,
  ZIMMessageSendConfig config, [
  ZIMMessageSendNotification? notification,
]);