SDKsuni-app / uni-app x
Get pending application count
Query the total count of unhandled friend requests.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
offset | number | No | Pagination offset index; pass 0 for the initial query. |
count | number | No | Maximum 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.
Was this page helpful?