getBlackList
Description
info
Get the blocklist.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<BlacklistInfo>> getBlackList({String? operationID})
Input Parameters
None
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| ~ | List<BlacklistInfo> | Success |
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 Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| onSuccess | NSArray< OIMBlackInfo * > | Success |
| onFailure | OIMFailureCallback | Failure |
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 | Parameter Type | Required | Description |
|---|---|---|---|
| callBack | OnBase<List<UserInfo>> | Yes | Callback interface |
Return Result
Code Example
OpenIMClient.getInstance().friendshipManager.getBlackList(new OnBase<List<UserInfo>>(){...})
Function Prototype
IMSDK.getBlackList(operationID?: string): Promise<WsResponse<BlackUserItem[]>>
Input Parameters
None
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<WsResponse<BlackUserItem[]>> | List of blocklist information objects |
| 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 { getSDK } from '@openim/client-sdk';
// const IMSDK = getSDK();
IMSDK.getBlackList()
.then(({ data }) => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
IMSDK.asyncApi('getBlackList', operationID: string): Promise<BlackUserItem[]>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | Yes | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
Return Result
Use the
openim-uniapp-polyfillpackage to make the function Promise. When calling, you need to usethenandcatchto determine and handle success and failure callbacks.
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<BlackUserItem[]> | List of blocklist information objects |
| Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getBlackList', IMSDK.uuid())
.then((data) => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
OpenIMSDK.getBlackList(operationID?: string): Promise<BlackUserItem[]>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | No | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<BlackUserItem[]> | List of blocklist information objects |
| Promise.catch() | Promise<OpenIMApiError> | Failure callback |
Code Example
import OpenIMSDK from "@openim/rn-client-sdk";
OpenIMSDK.getBlackList()
.then((data) => {
// Success
})
.catch((error) => {
// Failure
});