getFriendApplicationListAsRecipient
Feature Introduction
Note
Retrieve the list of friend requests where the current user is the recipient, meaning the friend requests they have received.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<FriendApplicationInfo>> getFriendApplicationListAsRecipient(
{String? operationID})
Input Parameters
None
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
~ | List<FriendApplicationInfo> | Successful Return |
Code Example
List<FriendApplicationInfo> list = await OpenIM.iMManager.friendshipManager.getFriendApplicationListAsRecipient();
// todo
Function Prototype
- (void)getFriendApplicationListWithOnSuccess:(nullable OIMFriendApplicationsCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
None
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
onSuccess | NSArray< OIMFriendApplication * > | Successful Return |
onFailure | OIMFailureCallback | Failure Return |
Code Example
[OIMManager.manager getFriendApplicationListWithOnSuccess:^(NSArray<OIMFriendApplication *> * _Nullable friendApplications) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void getRecvFriendApplicationList(OnBase<List<FriendApplicationInfo>> callBack)
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
callBack | OnBase<List<FriendApplicationInfo>> | Yes | Callback |
Return Results
Code Example
OpenIMClient.getInstance().friendshipManager.getRecvFriendApplicationList(new OnBase<List<FriendApplicationInfo>>(){...})
Function Prototype
IMSDK.getFriendApplicationListAsRecipient(operationID?: string): Promise<WsResponse<FriendApplication[]>>
Input Parameters
None
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse<FriendApplicationItem[]>> | List of friend requests received |
Promise.catch() | Promise<WsResponse> | Failure Callback |
Code Example
import { getSDK } from '@openim/wasm-client-sdk';
const IMSDK = getSDK();
// use in electron with ffi
// import { getWithRenderProcess } from '@openim/electron-client-sdk/lib/render';
// const { instance: IMSDK } = getWithRenderProcess();
// use in mini program
// import { OpenIMSDK } from 'open-im-sdk';
// const IMSDK = new OpenIMSDK();
IMSDK.getFriendApplicationListAsRecipient()
.then(({ data }) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('getFriendApplicationListAsRecipient', operationID: string): Promise<FriendApplication[]>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, for problem localization, keep unique, recommended to use current time with random number |
Return Results
The function is made into a Promise using the
openim-uniapp-polyfill
package. Usethen
andcatch
to determine and handle successful and failed callbacks respectively.
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<FriendApplicationItem[]> | List of friend requests received |
Promise.catch() | Promise<CatchResponse> | Failure Callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getFriendApplicationListAsRecipient', IMSDK.uuid())
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.getFriendApplicationListAsRecipient(operationID: string): Promise<FriendApplication[]>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used for problem location, keep unique, suggest using current time and random number |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<FriendApplicationItem[]> | 收到的好友请求list |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.getFriendApplicationListAsRecipient('operationID')
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
public static void GetFriendApplicationListAsRecipient(OnBase<List<FriendApplicationInfo>> cb)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
cb | OnBase<List<FriendApplicationInfo>> | Yes | Callback |
Return Result
Code Example
IMSDK.GetFriendApplicationListAsRecipient((list,errCode,errMsg)=>{
});