首页 > 解决方案 > Mesibo 未读消息组数

问题描述

我们如何在群组中获得未读消息。我们目前正在创建readDBSession并使用getUnreadCount。这个实现对于 peer id 来说工作得很好,但是当我们传递 group id 时,它就不起作用了。这是示例代码

//  groups= [{groupId: 1234}, {groupId: 5436}]
groups?.forEach((group) => {
      const readSession = window.api?.readDbSession(
        null,
        group.groupId,
        null,
        function on_read() {},
      );
      readSession?.getUnreadCount(function on_unread(count: number) {
        console.log(count);
      });
     readSession.stop();
    });
// if we pass peer address in readDbSession and 0 as group id then its working fine.

标签: javascriptmesibo

解决方案


推荐阅读