sendPeerMessage abstract method
- @Deprecated('Deprecated since ZIM 2.4.0, please use [sendMessage] instead.')
- ZIMMessage message,
- String toUserID,
- ZIMMessageSendConfig config
Send peer-to-peer messages.
Available since: 2.0.0 and above.
Description: After this function is called, a message is sent to the specified user. At the same time, a ZIMMessageSentCallback callback is received, which can be used to determine whether the message is sent successfully.
Use cases: This function is used in 1V1 chat scenarios.
Call timing/Notification timing: Can be invoked after login.
Caution: Be aware of the ZIMMessageSentCallback callback when sending. This callback can be used to determine if the send fails for some reason.Pushconfig Is required only when the offline push function is required.
Usage limit: no more than 10 /s, available after login, unavailable after logout.
Scope of influence: Using this method triggers the receivePeerMessage callback of the message receiver and the onConversationChanged callback of the sender and receiver. If message DND is not set for the session where the message is sent, Triggers conversationTotalUnreadMessageCountUpdated callback.
Related callbacks:ZIMMessageSentCallback、receivePeerMessage、onConversationChanged、conversationTotalUnreadMessageCountUpdated。
Related API: queryHistoryMessage、deleteMessageByConversationID、deleteMessage
@deprecated Deprecated since ZIM 2.4.0, please use sendMessage instead.
messageThe message to be sent.toUserIDThe ID of the user who will receive the message.configRelated configuration for sending single chat messages.
Implementation
@Deprecated('Deprecated since ZIM 2.4.0, please use [sendMessage] instead.')
Future<ZIMMessageSentResult> sendPeerMessage(
ZIMMessage message, String toUserID, ZIMMessageSendConfig config);