Browse SDKs · Android
SDKsAndroid

Get sent friend requests

Use getSendFriendApplicationList() to query sent friend requests by page.

Copy
GetFriendApplicationListAsApplicantReq request =
    new GetFriendApplicationListAsApplicantReq(0, 20);

OpenIMClient.getInstance().friendshipManager.getSendFriendApplicationList(
    new OnBase<List<FriendApplicationInfo>>() {
        @Override
        public void onSuccess(List<FriendApplicationInfo> applications) {
            replaceSentApplications(applications);
        }

        @Override
        public void onError(int code, String error) {
            recordSentApplicationFailure(code, error);
        }
    },
    request
);

offset starts at 0, and count is the page size. The callback returns the current page as List<FriendApplicationInfo>. Merge items by fromUserID:toUserID. This query only establishes a snapshot and does not trigger friend request callbacks.

For sent requests, the signed-in user is normally fromUserID. The record fields and handling semantics are the same as Get received friend requests: the Android server contract uses 0 for pending, 1 for accepted, and 2 for rejected.