V2TIMMessageManager class Null safety Manager

Provide advanced message APIs

addAdvancedMsgListener Add an event listener for advanced messages

removeAdvancedMsgListener Remove the event listener for advanced messages

sendCustomMessage Create custom messages

sendImageMessage Create picture messages (pictures up to 28 MB)

sendSoundMessage Create a voice message (voice supports up to 28 MB)

createVideoMessage Create video messages (videos up to 100 MB)

sendVideoMessage Create file message (files up to 100 MB supported)

getC2CHistoryMessageList Get historical one-to-one messages

getGroupHistoryMessageList Get historical group messages

getHistoryMessageList Get historical messages (advanced API)

revokeMessage Recall a message

markC2CMessageAsRead Mark one-to-one messages as read

markGroupMessageAsRead Mark group messages as read

deleteMessageFromLocalStorage Delete local messages

deleteMessages Delete local and roaming messages

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addAdvancedMsgListener({required V2TimAdvancedMsgListener listener}) Future<void>
Add an event listener for advanced messages
clearC2CHistoryMessage({required String userID}) Future<V2TimCallback>
Clear single chat local and cloud messages (without deleting the conversation) [...]
clearGroupHistoryMessage({required String groupID}) Future<V2TimCallback>
Clear the group chat local and cloud messages (do not delete the conversation) [...]
createCustomMessage({required String data, String desc = "", String extension = ""}) Future<V2TimValueCallback<V2TimMsgCreateInfoResult>>
Create custom messages [...]
createFaceMessage({required int index, required String data}) Future<V2TimValueCallback<V2TimMsgCreateInfoResult>>
Create emoticon message index Emoji index data Custom data Note: [...]
createFileMessage({required String filePath, required String fileName, Uint8List? fileContent}) Future<V2TimValueCallback<V2TimMsgCreateInfoResult>>
create file message [...]
createForwardMessage({required String msgID, String? webMessageInstance}) Future<V2TimValueCallback<V2TimMsgCreateInfoResult>>
createImageMessage({required String imagePath, Uint8List? fileContent, String? fileName}) Future<V2TimValueCallback<V2TimMsgCreateInfoResult>>
Create image messages (image files up to 28 MB) [...]
createLocationMessage({required String desc, required double longitude, required double latitude}) Future<V2TimValueCallback<V2TimMsgCreateInfoResult>>
Create location information longitude longitude, set latitude latitude when sending a message, set desc geographic location description information when sending a message
createMergerMessage({required List<String> msgIDList, required String title, required List<String> abstractList, required String compatibleText}) Future<V2TimValueCallback<V2TimMsgCreateInfoResult>>
Create merge message Parameters: [...]
createSoundMessage({required String soundPath, required int duration}) Future<V2TimValueCallback<V2TimMsgCreateInfoResult>>
Create audio file soundPath audio file address duration duration
createTargetedGroupMessage({required String id, required List<String> receiverList}) Future<V2TimValueCallback<V2TimMsgCreateInfoResult>>
If you need to send a message to the specified group member list in the group, you can create a targeted group message, and the targeted group message can only be received by the specified group members. [...]
createTextAtMessage({required String text, required List<String> atUserList}) Future<V2TimValueCallback<V2TimMsgCreateInfoResult>>
Create text messages with @reminders (up to 8KB supported) Reminders only apply to messages sent in groups [...]
createTextMessage({required String text}) Future<V2TimValueCallback<V2TimMsgCreateInfoResult>>
Create a text message [...]
createVideoMessage({required String videoFilePath, required String type, required int duration, required String snapshotPath, String? fileName, Uint8List? fileContent}) Future<V2TimValueCallback<V2TimMsgCreateInfoResult>>
Create video file videoFilePath path type video type, such as mp4 mov etc. duration video duration, unit s snapshotPath video cover image path fileName file name (onlyweb sideused and required) fileContent byte array (onlyweb sideused and required)
deleteMessageFromLocalStorage({required String msgID}) Future<V2TimCallback>
Delete local messages [...]
deleteMessages({required List<String> msgIDs, List? webMessageInstanceList}) Future<V2TimCallback>
Delete local and roaming messages [...]
downloadMergerMessage({required String msgID}) Future<V2TimValueCallback<List<V2TimMessage>>>
Get the sub-message list of the merged message (download the merged message list) Parameter: msgID msgID of the merged message
findMessages({required List<String> messageIDList}) Future<V2TimValueCallback<List<V2TimMessage>>>
Query local messages in the specified session based on messageID Parameter: messageIDList message ID list [...]
getC2CHistoryMessageList({required String userID, required int count, String? lastMsgID}) Future<V2TimValueCallback<List<V2TimMessage>>>
Get historical one-to-one messages [...]
getC2CReceiveMessageOpt({required List<String> userIDList}) Future<V2TimValueCallback<List<V2TimReceiveMessageOptInfo>>>
Query C2C message receiving options for a user [...]
getGroupHistoryMessageList({required String groupID, required int count, String? lastMsgID}) Future<V2TimValueCallback<List<V2TimMessage>>>
Get historical group messages [...]
getGroupMessageReadMemberList({required String messageID, required GetGroupMessageReadMemberListFilter filter, int nextSeq = 0, int count = 100}) Future<V2TimValueCallback<V2TimGroupMessageReadMemberList>>
Get the list of group members who have read group messages 3.9.3 and above are supported
getHistoryMessageList({HistoryMsgGetTypeEnum getType = HistoryMsgGetTypeEnum.V2TIM_GET_LOCAL_OLDER_MSG, String? userID, String? groupID, int lastMsgSeq = -1, required int count, String? lastMsgID}) Future<V2TimValueCallback<List<V2TimMessage>>>
Get historical messages (advanced API) [...]
getHistoryMessageListWithoutFormat({HistoryMsgGetTypeEnum getType = HistoryMsgGetTypeEnum.V2TIM_GET_LOCAL_OLDER_MSG, String? userID, String? groupID, int lastMsgSeq = -1, required int count, String? lastMsgID}) Future<LinkedHashMap>
Get the high-level interface of historical messages (no processing of native return data) [...]
getMessageReadReceipts({required List<String> messageIDList}) Future<V2TimValueCallback<List<V2TimMessageReceipt>>>
Get message read receipt Version 3.9.3 and above is supported This interface only supports Group messages temporarily. The message IDs in messageIDList must be in the same Group session.
insertC2CMessageToLocalStorage({required String data, required String userID, required String sender}) Future<V2TimValueCallback<V2TimMessage>>
Add a message to the message list of a one-to-one chat [...]
insertGroupMessageToLocalStorage({required String data, required String groupID, required String sender}) Future<V2TimValueCallback<V2TimMessage>>
Add a message to the group message list This interface is mainly used to meet the needs of inserting some prompt messages into the group chat session, such as 'You have left the group', such messages are displayed in the chat message area. demand, but there is no need to send it to others. So insertGroupMessageToLocalStorage() is equivalent to a sendMessage() interface with the network sending capability disabled. [...]
markAllMessageAsRead() Future<V2TimCallback>
Mark all messages as read
markC2CMessageAsRead({required String userID}) Future<V2TimCallback>
Mark one-to-one messages as read
markGroupMessageAsRead({required String groupID}) Future<V2TimCallback>
Mark group messages as read
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
removeAdvancedMsgListener({V2TimAdvancedMsgListener? listener}) Future<void>
Remove the event listener for advanced messages
reSendMessage({required String msgID, bool onlineUserOnly = false, Object? webMessageInstatnce}) Future<V2TimValueCallback<V2TimMessage>>
Resend a message [...]
revokeMessage({required String msgID, Object? webMessageInstatnce}) Future<V2TimCallback>
Recall a message [...]
searchLocalMessages({required V2TimMessageSearchParam searchParam}) Future<V2TimValueCallback<V2TimMessageSearchResult>>
Search local messages Parameters: searchParam message search parameters, see details V2TimMessageSearchParam Definition [...]
sendCustomMessage({required String data, required String receiver, required String groupID, MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL, String desc = "", String extension = "", bool onlineUserOnly = false, bool isExcludedFromUnreadCount = false, OfflinePushInfo? offlinePushInfo}) Future<V2TimValueCallback<V2TimMessage>>
Send a custom message
@Deprecated('sendCustomMessage has been deprecated since 3.6.0, we separate the creation of the message from the sending of the message, please use createCustomMessage to create a message first, and then call sendMessage to send the message')
sendFaceMessage({required int index, required String data, required String receiver, required String groupID, MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL, bool onlineUserOnly = false, bool isExcludedFromUnreadCount = false, OfflinePushInfo? offlinePushInfo}) Future<V2TimValueCallback<V2TimMessage>>
Create an emoji message [...]
@Deprecated('sendFaceMessage has been deprecated since 3.6.0, we separate the creation of the message from the sending of the message, please use createFaceMessage to create the message first, and then call sendMessage to send the message')
sendFileMessage({required String filePath, required String fileName, required String receiver, required String groupID, MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL, bool onlineUserOnly = false, bool isExcludedFromUnreadCount = false, OfflinePushInfo? offlinePushInfo, Uint8List? fileContent}) Future<V2TimValueCallback<V2TimMessage>>
Send file web side fileName and fileContent are required fields
@Deprecated('sendFileMessage has been deprecated since 3.6.0, we separate the creation of messages from the sending of messages, please use createFileMessage to create a message first, and then call sendMessage to send the message')
sendForwardMessage({required String msgID, required String receiver, required String groupID, MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL, bool onlineUserOnly = false, bool isExcludedFromUnreadCount = false, OfflinePushInfo? offlinePushInfo, String? webMessageInstance}) Future<V2TimValueCallback<V2TimMessage>>
Forward a message [...]
@Deprecated('sendForwardMessage has been deprecated since 3.6.0, we separate the creation of the message from the sending of the message, please use createForwardMessage to create a message first, and then call sendMessage to send the message')
sendImageMessage({required String imagePath, required String receiver, required String groupID, MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL, bool onlineUserOnly = false, bool isExcludedFromUnreadCount = false, OfflinePushInfo? offlinePushInfo, String? fileName, Uint8List? fileContent}) Future<V2TimValueCallback<V2TimMessage>>
Send image message [...]
@Deprecated('sendImageMessage has been deprecated since 3.6.0, we separate the creation of the message from the sending of the message, please use createImageMessage to create a message first, and then call sendMessage to send the message')
sendLocationMessage({required String desc, required double longitude, required double latitude, required String receiver, required String groupID, MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL, bool onlineUserOnly = false, bool isExcludedFromUnreadCount = false, OfflinePushInfo? offlinePushInfo}) Future<V2TimValueCallback<V2TimMessage>>
Send geographical location message
@Deprecated('sendLocationMessage has been deprecated since 3.6.0, we separate the creation of the message from the sending of the message, please use createLocationMessage to create a message first, and then call sendMessage to send the message')
sendMergerMessage({required List<String> msgIDList, required String title, required List<String> abstractList, required String compatibleText, required String receiver, required String groupID, MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL, bool onlineUserOnly = false, bool isExcludedFromUnreadCount = false, OfflinePushInfo? offlinePushInfo, List<String>? webMessageInstanceList}) Future<V2TimValueCallback<V2TimMessage>>
Combined message [...]
@Deprecated('sendMergerMessage has been deprecated since 3.6.0, we separate the creation of the message from the sending of the message, please use createMergerMessage to create a message, and then call sendMessage to send the message')
sendMessage({required String id, required String receiver, required String groupID, MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL, bool onlineUserOnly = false, bool isExcludedFromUnreadCount = false, bool needReadReceipt = false, OfflinePushInfo? offlinePushInfo, String? cloudCustomData, String? localCustomData}) Future<V2TimValueCallback<V2TimMessage>>
Send message Parameters [...]
sendMessageReadReceipts({required List<String> messageIDList}) Future<V2TimCallback>
Send message read receipt Version 3.9.3 and above is supported This interface only supports Group messages temporarily. The message IDs in messageIDList must be in the same Group session. After the API is called successfully, the session unread will not change, and the message sender will receive the onRecvMessageReadReceipts callback, which will carry the latest read information of the message. Parameters: messageIDList, message ID list Note: web does not support this taboo
sendReplyMessage({required String id, required String receiver, required String groupID, required V2TimMessage replyMessage, MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL, bool onlineUserOnly = false, bool isExcludedFromUnreadCount = false, bool needReadReceipt = false, OfflinePushInfo? offlinePushInfo, String? localCustomData}) Future<V2TimValueCallback<V2TimMessage>>
send reply message [...]
sendSoundMessage({required String soundPath, required String receiver, required String groupID, required int duration, MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL, bool onlineUserOnly = false, bool isExcludedFromUnreadCount = false, OfflinePushInfo? offlinePushInfo}) Future<V2TimValueCallback<V2TimMessage>>
Send a voice message [...]
@Deprecated('sendSoundMessage has been deprecated since 3.6.0, we separate the creation of the message from the sending of the message, please use createSoundMessage to create the message first, and then call sendMessage to send the message')
sendTextAtMessage({required String text, required List<String> atUserList, required String receiver, required String groupID, MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL, bool onlineUserOnly = false, bool isExcludedFromUnreadCount = false, OfflinePushInfo? offlinePushInfo}) Future<V2TimValueCallback<V2TimMessage>>
Create a text message with the @ notification feature [...]
@Deprecated('sendTextAtMessage has been deprecated since 3.6.0, we separate the creation of the message from the sending of the message, please use createTextAtMessage to create the message first, and then call sendMessage to send the message')
sendTextMessage({required String text, required String receiver, required String groupID, MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL, bool onlineUserOnly = false, bool isExcludedFromUnreadCount = false, OfflinePushInfo? offlinePushInfo}) Future<V2TimValueCallback<V2TimMessage>>
Send advanced text messages
@Deprecated('sendTextMessage has been deprecated since 3.6.0, we separate the creation of messages from the sending of messages, please use createTextMessage to create messages first, and then call sendMessage to send messages')
sendVideoMessage({required String videoFilePath, required String receiver, required String type, required String snapshotPath, required int duration, required String groupID, MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL, bool onlineUserOnly = false, bool isExcludedFromUnreadCount = false, OfflinePushInfo? offlinePushInfo, String? fileName, Uint8List? fileContent}) Future<V2TimValueCallback<V2TimMessage>>
Send a video message [...]
@Deprecated('sendVideoMessage has been deprecated since 3.6.0, we separate the creation and sending of messages, please use createVideoMessage to create a message, and then call sendMessage to send the message')
setC2CReceiveMessageOpt({required List<String> userIDList, required ReceiveMsgOptEnum opt}) Future<V2TimCallback>
Get the user message receiving option [...]
setCloudCustomData({required String data, required String msgID}) Future<V2TimCallback>
Set cloud custom data (saved in the cloud, will be sent to the peer end, and can still be pulled after the app is uninstalled and reinstalled) [...]
@Deprecated('Deprecated, please use custom data when creating message')
setGroupReceiveMessageOpt({required String groupID, required ReceiveMsgOptEnum opt}) Future<V2TimCallback>
Modify the group message receiving option [...]
setLocalCustomData({required String msgID, required String localCustomData}) Future<V2TimCallback>
Set message custom data (saved locally, will not be sent to the opposite end, and will be invalid after the program is uninstalled and reinstalled) localCustomData is just transparent transmission Note: web does not support this interface
setLocalCustomInt({required String msgID, required int localCustomInt}) Future<V2TimCallback>
Set custom message data and can be used to mark whether a voice or video message is played (saved locally, will not be sent to the peer end, and will become invalid after the app is uninstalled and reinstalled) [...]
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited