javascript - 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.
解决方案
推荐阅读
- java - Spring手动注册?
- python - pybind11 以某种方式减慢了 c++ 函数
- mongodb - 在 BSON 中解码,这是一个由私有结构实现的接口
- mysql - 计算按国家和日期细分的每个项目的总收入
- javascript - 使用 Gatsby 和 allImageSharp 上下文定位特定文件夹
- c# - C# 两个不同数据库的简单减法
- python - 在运行时获取闭包
- mysql - MySQL;在一个请求中获取与每张卡片相关的所有卡片和所有卡片组
- xamarin - 是否有 API 端点可以通过 REST API(在 C# 中)与 Sharepoint 中的其他用户在线和本地共享元素(文件、项目、站点等)?
- swift - 转换为错误失败,但转换为 NSError 成功