SDKsHarmonyOSEnterprise
Retrieve sent friend applications
Paginate friend requests dispatched by the current signed-in user.
Pass send: true to paginate friend requests initiated by the signed-in account:
Code example
import sdk, { GetFriendApplicationReq, GetFriendApplicationResp } from '@openimsdk/imsdk';
const request: GetFriendApplicationReq = {
send: true,
handleResults: [],
pagination: {
pageNumber: 1,
showNumber: 20,
},
};
const response: GetFriendApplicationResp = await sdk.getFriendApplication(request);
showSentApplications(response.applications);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
send | boolean | Yes | Set to true to query outgoing requests sent by the current user. |
handleResults | HandleResult[] | Yes | Filter array by review status; pass [] to query all states. |
pagination.pageNumber | number | Yes | Page index, starting from 1. |
pagination.showNumber | number | Yes | Number of requests to fetch per page. |
Return value
Returns a Promise that resolves to a GetFriendApplicationResp object containing applications: IMFriendApplication[]:
| Property | Type | Description |
|---|---|---|
fromUserID | string | Current user ID (sender). |
toUserID | string | Target user ID (recipient). |
handleResult | HandleResult | Current review status (ResultDefault, ResultAccept, or ResultDecline). |
reqMsg | string | Verification note attached by the sender. |
handleMsg | string | Note returned by the reviewer. |
createTime | number | Request dispatch timestamp in Unix milliseconds. |
State changes after the call
Track application records locally using the composite key fromUserID:toUserID. This query executes locally and does not emit events. For incoming request event listeners, see Retrieve received friend applications.
Was this page helpful?