浏览 SDKs · HarmonyOS
平台
SDKsHarmonyOS商业版

获取未处理入群申请数

查询指定时间点之后需要当前账号处理的入群申请数量。

复制

该数量适合显示群管理待办,不等同于申请入口角标。

import sdk, {
  GetGroupApplicationUnhandledCountReq,
  GetGroupApplicationUnhandledCountResp,
} from '@openimsdk/imsdk';

const request: GetGroupApplicationUnhandledCountReq = { time: 0 };
const response: GetGroupApplicationUnhandledCountResp =
  await sdk.getGroupApplicationUnhandledCount(request);
setPendingApplicationCount(response.unhandledCount);

time 是统计起点的 Unix 毫秒时间戳;传 0 表示统计全部未处理申请。查询不会修改申请状态,也不会清除入口角标。