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

Delete friend-request records

Commercially delete selected friend-request records in a batch.

Copy

deleteFriendRequests() is Commercial.

Parameters

The operation receives OpenIMDeleteFriendRequestsParams. Every item in friendRequests contains:

ParameterTypeRequiredDescription
friendRequests[].fromUserIDstringYesUser ID of the applicant.
friendRequests[].toUserIDstringYesUser ID of the recipient.
import { deleteFriendRequests } from '@/uni_modules/unix-openim-sdk'

await deleteFriendRequests({
  friendRequests: [
    { fromUserID: 'user_a', toUserID: 'user_b' },
  ],
})

Each OpenIMSimpleFriendRequest identifies an exact request by fromUserID:toUserID. Deleting request history is not the same as rejecting an application and does not remove an established friendship. Use the friend deletion API to end a friendship.

Promise success means that the deletion request completed. onFriendApplicationDeleted can arrive afterward; the complete listener is on Get received friend applications, where records are removed by fromUserID:toUserID.

Confirm batch targets in the UI. After failure, do not assume that every or no item was deleted; requery both received and sent application lists to reconcile with the server snapshot.