deleteRemoteMessages static method
删除指定的一条或者一组消息。会同时删除本地和远端消息 会话类型, 不支持聊天室
Implementation
static Future<void> deleteRemoteMessages(int? conversationType, String? targetId, List<Message> messages, Function(int? code)? finished) async {
if (conversationType == null || targetId == null) {
developer.log("deleteRemoteMessages fail: conversationType or targetId or content is null", name: "RongIMClient");
return null;
}
List<Map> msgMapList = [];
for (Message message in messages) {
msgMapList.add(MessageFactory.instance!.message2Map(message));
}
Map paramMap = {"conversationType": conversationType, "targetId": targetId, "messages": msgMapList};
int? result = await _channel.invokeMethod(RCMethodKey.DeleteRemoteMessages, paramMap);
if (finished != null) {
finished(result);
}
}