MessageManager class
Methods
createAdvancedQuoteMessage ({required String text , required Message quoteMsg , List <RichMessageInfo > list = const [] , String ? operationID })
→ Future <Message >
Rich text message with quote
text
Content for the reply
quoteMsg
The message being replied to
list
Details of the rich text message
createAdvancedTextMessage ({required String text , List <RichMessageInfo > list = const [] , String ? operationID })
→ Future <Message >
Rich text message
text
Input content
list
Details of the rich text message
createCardMessage ({required String userID , required String nickname , String ? faceURL , String ? ex , String ? operationID })
→ Future <Message >
Create a card message
data
Custom data
createCustomMessage ({required String data , required String extension , required String description , String ? operationID })
→ Future <Message >
Create a custom message
data
Custom data
extension
Custom extension content
description
Custom description content
createFaceMessage ({int index = -1 , String ? data , String ? operationID })
→ Future <Message >
Create a custom emoji message
index
Positional emoji, matched based on index
data
URL emoji, displayed directly using the URL
createFileMessage ({required String filePath , required String fileName , String ? operationID })
→ Future <Message >
Create a file message
filePath
Path
fileName
File name
createFileMessageByURL ({required FileElem fileElem , String ? operationID })
→ Future <Message >
Create a file message
createFileMessageFromFullPath ({required String filePath , required String fileName , String ? operationID })
→ Future <Message >
Create a file message from a full path
filePath
Path
fileName
File name
createForwardMessage ({required Message message , String ? operationID })
→ Future <Message >
Create a forwarded message
message
Message to be forwarded
createImageMessage ({required String imagePath , String ? operationID })
→ Future <Message >
Create an image message
imagePath
Path
createImageMessageByURL ({required PictureInfo sourcePicture , required PictureInfo bigPicture , required PictureInfo snapshotPicture , String ? sourcePath , String ? operationID })
→ Future <Message >
Create an image message by URL
createImageMessageFromFullPath ({required String imagePath , String ? operationID })
→ Future <Message >
Create an image message from a full path
imagePath
Path
createLocationMessage ({required double latitude , required double longitude , required String description , String ? operationID })
→ Future <Message >
Create a location message
latitude
Latitude
longitude
Longitude
description
Custom description
createMergerMessage ({required List <Message > messageList , required String title , required List <String > summaryList , String ? operationID })
→ Future <Message >
Create a merged message
messageList
Selected messages
title
Summary title
summaryList
Summary content
createQuoteMessage ({required String text , required Message quoteMsg , String ? operationID })
→ Future <Message >
Create a quoted message
text
Reply content
quoteMsg
Message being replied to
createSoundMessage ({required String soundPath , required int duration , String ? operationID })
→ Future <Message >
Create a sound message
soundPath
Path
duration
Duration in seconds
createSoundMessageByURL ({required SoundElem soundElem , String ? operationID })
→ Future <Message >
Create a sound message
createSoundMessageFromFullPath ({required String soundPath , required int duration , String ? operationID })
→ Future <Message >
Create a sound message from a full path
soundPath
Path
duration
Duration in seconds
createTextAtMessage ({required String text , required List <String > atUserIDList , List <AtUserInfo > atUserInfoList = const [] , Message ? quoteMessage , String ? operationID })
→ Future <Message >
Create an @ message
text
Input content
atUserIDList
Collection of userIDs being mentioned
atUserInfoList
Mapping of userID to nickname, used for displaying nicknames instead of IDs in the user interface
quoteMessage
Quoted message (the message being replied to)
createTextMessage ({required String text , String ? operationID })
→ Future <Message >
Create a text message
createVideoMessage ({required String videoPath , required String videoType , required int duration , required String snapshotPath , String ? operationID })
→ Future <Message >
Create a video message
videoPath
Path
videoType
Video MIME type
duration
Duration in seconds
snapshotPath
Default snapshot image path
createVideoMessageByURL ({required VideoElem videoElem , String ? operationID })
→ Future <Message >
Create a video message
createVideoMessageFromFullPath ({required String videoPath , required String videoType , required int duration , required String snapshotPath , String ? operationID })
→ Future <Message >
Create a video message from a full path
videoPath
Path
videoType
Video MIME type
duration
Duration in seconds
snapshotPath
Default snapshot image path
deleteAllMsgFromLocal ({String ? operationID })
→ Future
Delete all local chat records
deleteAllMsgFromLocalAndSvr ({String ? operationID })
→ Future
Delete all chat records from local and server
deleteMessageFromLocalAndSvr ({required String conversationID , required String clientMsgID , String ? operationID })
→ Future
core-sdk: DeleteMessage
Delete a specified message from local and server
message
Message to be deleted
deleteMessageFromLocalStorage ({required String conversationID , required String clientMsgID , String ? operationID })
→ Future
Delete a message from local storage
message
Message to be deleted
findMessageList ({required List <SearchParams > searchParams , String ? operationID })
→ Future <SearchResult >
Find message details
conversationID
Conversation ID
clientMsgIDList
List of message IDs
getAdvancedHistoryMessageList ({String ? conversationID , Message ? startMsg , int ? lastMinSeq , int ? count , String ? operationID })
→ Future <AdvancedMessage >
Get chat history (messages prior to startMsg)
conversationID
Conversation ID, can be used for querying notifications
startMsg
Query count
messages starting from this message. The message at index == length - 1 is the latest message, so to get the next page of history, use startMsg = list.first
count
Total number of messages to retrieve in one request
lastMinSeq
Not required for the first page of messages, but necessary for getting the second page of history. Same as startMsg
getAdvancedHistoryMessageListReverse ({String ? conversationID , Message ? startMsg , int ? lastMinSeq , int ? count , String ? operationID })
→ Future <AdvancedMessage >
Get chat history (newly received chat history after startMsg). Used for locating a specific message in global search and then fetching messages received after that message.
conversationID
Conversation ID, can be used for querying notifications
startMsg
Query count
messages starting from this message. The message at index == length - 1 is the latest message, so to get the next page of history, use startMsg = list.last
count
Total number of messages to retrieve in one request
insertGroupMessageToLocalStorage ({String ? groupID , String ? senderID , Message ? message , String ? operationID })
→ Future <Message >
Insert a group chat message into local storage
groupID
Group ID
senderID
Sender's ID
message
Message content
insertSingleMessageToLocalStorage ({String ? receiverID , String ? senderID , Message ? message , String ? operationID })
→ Future <Message >
Insert a single chat message into local storage
receiverID
Receiver's ID
senderID
Sender's ID
message
Message content
markMessagesAsReadByMsgID ({required String conversationID , required List <String > messageIDList , String ? operationID })
→ Future
Mark messages as read
conversationID
Conversation ID
messageIDList
List of clientMsgIDs of messages to be marked as read
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
revokeMessage ({required String conversationID , required String clientMsgID , String ? operationID })
→ Future
Revoke a message
message
The message to be revoked
searchLocalMessages ({String ? conversationID , List <String > keywordList = const [] , int keywordListMatchType = 0 , List <String > senderUserIDList = const [] , List <int > messageTypeList = const [] , int searchTimePosition = 0 , int searchTimePeriod = 0 , int pageIndex = 1 , int count = 40 , String ? operationID })
→ Future <SearchResult >
Search messages
conversationID
Query based on conversation, pass null for global search
keywordList
Search keyword list, currently supports searching with a single keyword
keywordListMatchType
Keyword matching mode, 1 means AND, 2 means OR (currently unused)
senderUserIDList
List of UIDs for messages sent (currently unused)
messageTypeList
Message type list
searchTimePosition
Start time point for searching. Defaults to 0, meaning searching from now. UTC timestamp, in seconds
searchTimePeriod
Time range in the past from the start time point, in seconds. Defaults to 0, meaning no time range limitation. Pass 24x60x60 to represent the past day
pageIndex
Current page number
count
Number of messages per page
sendMessage ({required Message message , required OfflinePushInfo offlinePushInfo , String ? userID , String ? groupID , bool isOnlineOnly = false , String ? operationID })
→ Future <Message >
Send a message
message
Message content
userID
User ID of the recipient
groupID
Group ID of the recipient
offlinePushInfo
Offline message display content
sendMessageNotOss ({required Message message , required OfflinePushInfo offlinePushInfo , String ? userID , String ? groupID , bool isOnlineOnly = false , String ? operationID })
→ Future <Message >
Send a message
message
Message body createImageMessageByURL ,createSoundMessageByURL ,createVideoMessageByURL ,createFileMessageByURL
userID
User ID to receive the message
groupID
Group ID to receive the message
offlinePushInfo
Offline message display content
setAdvancedMsgListener (OnAdvancedMsgListener listener )
→ Future
Message listener
setAppBadge (int count , {String ? operationID })
→ Future
setCustomBusinessListener (OnCustomBusinessListener listener )
→ Future
setMessageLocalEx ({required String conversationID , required String clientMsgID , required String localEx , String ? operationID })
→ Future
setMsgSendProgressListener (OnMsgSendProgressListener listener )
→ void
Message send progress listener
toString ()
→ String
A string representation of this object.
inherited
typingStatusUpdate ({required String userID , String ? msgTip , String ? operationID })
→ Future
Typing status update
msgTip
Custom content