sendReplyMessage method Null safety
- {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}
send reply message
This id is the id of the message you want to reply to. For example, I send a text message: "Eula Euler", you reply to the message text message "Damu Damu", the reply text message "Damu Damu" needs to be created, and its id is this id
Implementation
Future<V2TimValueCallback<V2TimMessage>> sendReplyMessage(
{required String id, // ID created by myself
required String receiver,
required String groupID,
required V2TimMessage replyMessage, / ;/ Reply message
MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL,
bool onlineUserOnly = false,
bool isExcludedFromUnreadCount = false,
bool needReadReceipt = false,
OfflinePushInfo? offlinePushInfo,
String? localCustomData }) async {
final hasNickName =
replyMessage.nickName != null && replyMessage.nickName != "";
final cloudCustomData = {
"messageReply": {
"messageID" ;: replyMessage.msgID,
"messageAbstract": _getAbstractMessage(replyMessage),
"messageSender":
hasNickName ? replyMessage.nickName : replyMessage.sender,
"messageType": replyMessage.elemType,
"version": 1
}
} ;
return ImFlutterPlatform.instance.sendMessage(
id: id,
receiver: receiver,
groupID: groupID,
needReadReceipt: needReadReceipt,
priority: EnumUtils.convertMessagePriorityEnum(priority),
onlineUserOnly : onlineUserOnly,
isExcludedFromUnreadCount: isExcludedFromUnreadCount,
offlinePushInfo: offlinePushInfo?.toJson(),
localCustomData: localCustomData,
cloudCustomData: json.encode(cloudCustomData));
}