Browse SDKs · uni-app / uni-app x
Platform
SDKsuni-app / uni-app x

Get pending application count

Query the total count of unhandled friend requests.

Copy

Invoke getFriendApplicationUnhandledCount() to retrieve the number of pending, unprocessed incoming friend requests. This count is typically used to render contact badge indicators and notification badges.

Parameters

ParameterTypeRequiredDescription
offsetnumberNoPagination offset index; pass 0 for the initial query.
countnumberNoMaximum number of records to evaluate during this count query.

Code example

import { getFriendApplicationUnhandledCount } from '@/uni_modules/unix-openim-sdk'

const pendingCount = await getFriendApplicationUnhandledCount({
  offset: 0,
  count: 100,
})

Return value

The Promise resolves with a number | null indicating the count of pending requests evaluated.

State changes after the call

This is a read-only query that reads local snapshot data without altering records or triggering events. To maintain real-time unhandled badge counters, initialize state using this query and adjust counters dynamically as friend application events arrive. Re-query upon re-authentication or network recovery. For event listeners, see Get received friend applications.