sendMergerMessage method Null safety
- @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')
- {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}
Combined message
Usually when we receive a combined message, the chat screen will look like this:
| Chat History of Vinson and Lynx | - Title
| Vinson: When is the new version of SDK scheduled to go online? | - abstract1 (Digest information 1)
| Lynx: Next Monday. The specific time depends on the system test result in these two days. | - abstract2 (Digest information 2)
| Vinson: OK | - abstract3 (Digest information 3)
The chat UI usually displays only the title and digest information of the combined message, and the complete combined message list will be displayed only when the user clicks the combined message on the UI.
You can create a combined message (V2TIMMessage) for multiple messages to be forwarded and call the sendMessage API to send the combined message. The procedure is as follows:
-
Call createMergerMessage to create a combined message V2TIMMessage.
-
Call sendMessage to send the forward message V2TIMMessage.
The procedure for parsing a combined message received is as follows:
-
Obtain mergerElem via V2TIMMessage.
-
Obtain title and abstractList via mergerElem for UI display.
-
When a user clicks the digest information on the UI, call downloadMessageList to get the list of forwarded messages.
Note
The webMessageInstanceList field must be passed in when using on the web side. The message instance returned on the web side will contain this field
Implementation
@Deprecated(
'sendMergerMessage has been deprecated since 3.6.0, we separate the creation and sending of messages, please use createMergerMessage to create a message, and then call sendMessage to send a message')
Future<V2TimValueCallback<V2TimMessage> ;> 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}) async {
return await ImFlutterPlatform.instance.sendMergerMessage(
msgIDList: msgIDList,
title: title,
abstractList: abstractList,
compatibleText: compatibleText,
receiver: receiver,
groupID: groupID,
priority: EnumUtils.convertMessagePriorityEnum(priority),
onlineUserOnly: onlineUse rOnly,
isExcludedFromUnreadCount: isExcludedFromUnreadCount,
offlinePushInfo: offlinePushInfo?.toJson(),
webMessageInstanceList: webMessageInstanceList);
}