Delete friend applications
Batch remove friend application records using composite applicant and recipient user IDs.
Invoke deleteFriendRequests() to purge one or more friend request records from application logs. Each element in friendRequests is identified by the composite pair of applicant and recipient user IDs.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
friendRequests | OpenIMSimpleFriendRequest[] | Yes | An array of friend requests to delete. |
friendRequests[].fromUserID | string | Yes | The applicant's user ID. |
friendRequests[].toUserID | string | Yes | The recipient's user ID. |
Code example
import { deleteFriendRequests } from '@/uni_modules/unix-openim-sdk'
await deleteFriendRequests({
friendRequests: [{
fromUserID,
toUserID,
}],
})Return value
The Promise resolves with void once OpenIMServer removes the specified application entries.
State changes after the call
Deleting an application record from history is distinct from rejecting a pending request; it does not alter friendship status between users. A resolved Promise confirms that the deletion request succeeded. Upon receiving onFriendApplicationDeleted, clients remove the record matching fromUserID:toUserID. For complete event registration logic, see Get received friend applications.
Was this page helpful?