getUnreadMentionedMessages static method

Future<List> getUnreadMentionedMessages(
  1. int conversationType,
  2. String targetId
)

获取会话中@提醒自己的消息

conversationType 会话类型,参见枚举 RCConversationType

targetId 会话 id

此方法从本地获取被@提醒的消息(最多返回10条信息) clearMessagesUnreadStatus: targetId: 以及设置消息接收状态接口 setMessageReceivedStatus:receivedStatus:会同步清除被提示信息状态。

Implementation

static Future<List /*Message*/ > getUnreadMentionedMessages(int conversationType, String targetId) async {
  Map map = {"conversationType": conversationType, "targetId": targetId};
  List? list = await _channel.invokeMethod(RCMethodKey.GetUnreadMentionedMessages, map);
  if (list == null) {
    return [];
  }
  List messageList = [];
  for (String conStr in list) {
    Message? msg = MessageFactory.instance!.string2Message(conStr);
    messageList.add(msg);
  }
  return messageList;
}