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) {
            markApplicationRejected(applicantUserID);
        }

        @Override
        public void onError(int code, String error) {
            recordApplicationRejectFailure(code, error);
        }
    },
    applicantUserID,
    "Not now"
);

applicantUserID identifies the applicant, and the final argument is the handling message. A successful callback means the reject request completed. Merge request state through the shared friend request listener; the final rejected state is handleResult == 2.