Browse SDKs · iOS
Platform
SDKsiOS

Retrieve sent friend requests

Retrieve friend requests sent by the current iOS user with pagination.

Copy

Retrieve friend requests sent by the authenticated user with pagination using getFriendApplicationListAsApplicantWithReq:onSuccess:onFailure:.

Parameters

ParameterTypeRequiredDescription
reqGetFriendApplicationListAsApplicantReq *YesRequest configuration object for sent applications.

Request attributes (GetFriendApplicationListAsApplicantReq)

ParameterTypeRequiredDescription
offsetNSIntegerYesStarting offset for pagination. Pass 0 for the first page.
countNSIntegerYesNumber of application records to fetch per page.

Code example

GetFriendApplicationListAsApplicantReq *req = [GetFriendApplicationListAsApplicantReq new];
req.offset = 0;
req.count = 20;

[[OIMManager manager] getFriendApplicationListAsApplicantWithReq:req
                                                       onSuccess:^(NSArray<OIMFriendApplication *> *items) {
                                                           [requestStore replaceSent:items];
                                                       }
                                                       onFailure:^(NSInteger code, NSString *message) {
                                                           NSLog(@"getFriendApplicationListAsApplicant failed: %ld %@", (long)code, message);
                                                       }];

Return value

The onSuccess callback returns an NSArray<OIMFriendApplication *> * containing the outgoing friend requests for the current page.

State changes after the call

  • Local state merge: Merge sent request records using fromUserID:toUserID as the unique composite entity key.
  • Snapshot query: This query establishes an instantaneous point-in-time snapshot and does not emit delegate callbacks.
  • Asynchronous responses: When target users accept or reject outgoing requests, notifications arrive via OIMFriendshipListener callbacks (see Retrieve received friend requests).