SDKsiOS
Retrieve sent friend requests
Retrieve friend requests sent by the current iOS user with pagination.
Retrieve friend requests sent by the authenticated user with pagination using getFriendApplicationListAsApplicantWithReq:onSuccess:onFailure:.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
req | GetFriendApplicationListAsApplicantReq * | Yes | Request configuration object for sent applications. |
Request attributes (GetFriendApplicationListAsApplicantReq)
| Parameter | Type | Required | Description |
|---|---|---|---|
offset | NSInteger | Yes | Starting offset for pagination. Pass 0 for the first page. |
count | NSInteger | Yes | Number 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:toUserIDas 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
OIMFriendshipListenercallbacks (see Retrieve received friend requests).
Was this page helpful?