Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Get unhandled friend application count

Query the number of pending friend applications created after a specific timestamp.

Copy

Query the count of unhandled friend requests since a specific point in time:

Code example

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

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

Parameters

ParameterTypeRequiredDescription
timenumberYesUnix timestamp in milliseconds as the starting filter point. Pass 0 to count all unhandled requests.

Return value

Returns a Promise that resolves to a GetFriendApplicationUnhandledCountResp object:

PropertyTypeDescription
unhandledCountnumberNumber of unhandled friend requests created after time.

State changes after the call

This query does not modify application records or emit events. To view and process incoming requests, see Retrieve received friend applications.