浏览 SDKs · HarmonyOS
平台
SDKsHarmonyOS商业版

获取未处理好友申请数

查询指定时间点之后的未处理好友申请数量。

复制
import sdk, {
  GetFriendApplicationUnhandledCountReq,
  GetFriendApplicationUnhandledCountResp,
} from '@openimsdk/imsdk';

const request: GetFriendApplicationUnhandledCountReq = {
  time: lastViewedAt,
};
const response: GetFriendApplicationUnhandledCountResp =
  await sdk.getFriendApplicationUnhandledCount(request);
showPendingFriendCount(response.unhandledCount);

time 是统计起点的 Unix 毫秒时间戳;传 0 表示统计全部未处理申请。查询不会修改申请或触发事件。