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

Delete friend applications

Batch remove friend application records using composite applicant and recipient user IDs.

Copy

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

ParameterTypeRequiredDescription
friendRequestsOpenIMSimpleFriendRequest[]YesAn array of friend requests to delete.
friendRequests[].fromUserIDstringYesThe applicant's user ID.
friendRequests[].toUserIDstringYesThe 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.