getBlackList
Feature Introduction
Description
Retrieve the blacklist, returning those blacklisted by the user.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<BlacklistInfo>> getBlackList({String? operationID})
Input Parameters
None
Return Results
Parameter Name | Data Type | Description |
---|---|---|
~ | List<BlacklistInfo> | Successful return |
Code Example
List<BlacklistInfo> list = await OpenIM.iMManager.friendshipManager.getBlackList();
// todo
Function Prototype
- (void)getBlackListWithOnSuccess:(nullable OIMBlacksInfoCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
None
Return Results
Parameter Name | Data Type | Description |
---|---|---|
onSuccess | NSArray< OIMBlackInfo * > | Successful return |
onFailure | OIMFailureCallback | Failure return |
Code Example
[OIMManager.manager getBlackListWithOnSuccess:^(NSArray<OIMBlackInfo *> * _Nullable userInfos) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void getBlackList(OnBase<List<UserInfo>> callBack)
Input Parameters
Parameter Name | Data Type | Required | Description |
---|---|---|---|
callBack | OnBase<List<UserInfo>> | Yes | Callback interface |
Return Results
Code Example
OpenIMClient.getInstance().friendshipManager.getBlackList(new OnBase<List<UserInfo>>(){...})
Function Prototype
IMSDK.getBlackList(operationID?: string): Promise<WsResponse<BlackUserItem[]>>
Input Parameters
None
Return Results
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse<BlackUserItem[]>> | Blacklist user object list |
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.getBlackList()
.then(({ data }) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('getBlackList', operationID: string): Promise<BlackUserItem[]>
Input Parameters
Parameter Name | Data Type | Required | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, for troubleshooting, unique. Suggested to use current time and random number |
Return Results
The
openim-uniapp-polyfill
package makes the function Promise-based. When calling, you need to usethen
andcatch
to determine and handle the success and failure callbacks.
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<BlackUserItem[]> | Blacklist user object list |
Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getBlackList', IMSDK.uuid())
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.getBlackList(operationID: string): Promise<BlackUserItem[]>
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 | Data Type | Description |
---|---|---|
Promise.then() | Promise<BlackUserItem[]> | Blacklist user object list |
Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.getBlackList('operationID')
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});