Browse SDKs · Android
SDKsAndroid

Reject a friend request

Use refuseFriendApplication() to reject a friend request.

Copy
OpenIMClient.getInstance().friendshipManager.refuseFriendApplication(
    new OnBase<String>() {
        @Override
        public void onSuccess(String data) {
            // Friend request rejected successfully.
        }

        @Override
        public void onError(int code, String error) {
            // Handle the error.
        }
    },
    applicantUserID,
    "Not now"
);

applicantUserID identifies the applicant, and the final argument is the handling message. A successful callback means the reject-friend-request call completed. OnFriendshipListener reports the application status; handleResult == 2 means rejected.