removeBlack
Feature Introduction
Description
Remove a user from your blacklist.
Note
Related Callback: onBlackDeleted
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<dynamic> removeBlacklist({
required String userID,
String? operationID,
})
Input Parameters
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
userID | String | Yes | User ID |
Return Value
Parameter Name | Data Type | Description |
---|---|---|
~ | ~ | Success if no exception thrown |
Code Example
await OpenIM.iMManager.friendshipManager.removeBlacklist(
userID: 'userID',
);
// todo
Function Prototype
- (void)removeFromBlackList:(NSString *)userID
onSuccess:(OIMSuccessCallback)onSuccess
onFailure:(OIMFailureCallback)onFailure;
Input Parameters
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
userID | NSString | Yes | User ID |
Return Value
Parameter Name | Data Type | Description |
---|---|---|
onSuccess | OIMSuccessCallback | Success return |
onFailure | OIMFailureCallback | Failure return |
Code Example
[OIMManager.manager removeFromBlackList:@""
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void removeBlacklist(OnBase<String> callBack, String uid)
Input Parameters
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
callBack | OnBase | Yes | Callback Interface |
uid | String | Yes | User ID |
Return Value
Code Example
OpenIMClient.getInstance().friendshipManager.removeBlacklist(new OnBase<String>(){…},uid)
Function Prototype
IMSDK.removeBlack(userID: string, operationID?: string): Promise<WsResponse>
Input Parameters
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
userID | string | Yes | User ID |
Return Value
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse> | Success Callback |
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.removeBlack('userID')
.then(() => {
// Successful Call
})
.catch(({ errCode, errMsg }) => {
// Failed Call
});
Function Prototype
IMSDK.asyncApi('removeBlack', operationID: string, userID: string): Promise<void>
Input Parameters
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, unique identifier, suggested to use current timestamp combined with a random number |
userID | string | Yes | User ID |
Return Value
The function is promisified by the
openim-uniapp-polyfill
package. Usethen
andcatch
to handle success and failure callbacks.
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<void> | Success Callback |
Promise.catch() | Promise<CatchResponse> | Failure Callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('removeBlack', IMSDK.uuid(), 'userID')
.then(() => {
// Successful Call
})
.catch(({ errCode, errMsg }) => {
// Failed Call
});
Function Prototype
OpenIMSDKRN.removeBlack(userID: string, operationID: string): Promise<void>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
userID | string | Yes | User ID |
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<void> | Callback on successful call |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.removeBlack('userID', 'operationID')
.then(() => {
// Successful Call
})
.catch(({ errCode, errMsg }) => {
// Failed Call
});