hideAllConversation
Feature Introduction
Note
Hides all local conversations without deleting the messages within the conversation. The conversation will appear when a new message is received.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- Unity
Function Prototype
Future<dynamic> deleteAllConversationFromLocal({
String? operationID,
})
Input Parameters
None
Return Results
Name | Type | Description |
---|---|---|
~ | ~ | Operation is successful if no exceptions are thrown |
Code Example
await OpenIM.iMManager.conversationManager.deleteAllConversationFromLocal();
//todo
Function Prototype
- (void)deleteAllConversationFromLocalWithOnSuccess:(nullable OIMSuccessCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
None
Return Results
Name | Type | Description |
---|---|---|
onSuccess | OIMSuccessCallback | Successful return |
onFailure | OIMFailureCallback | Failed return |
Code Example
[OIMManager.manager deleteAllConversationFromLocalWithOnSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void deleteAllConversationFromLocal(OnBase<String> base)
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
base | OnBase | Yes | Callback interface |
Code Example
OpenIMClient.getInstance().messageManager.deleteAllMsgFromLocalAndSvr(new OnBase<String>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(String data) {
}
});
Function Prototype
IMSDK.deleteAllConversationFromLocal(operationID?: string): Promise<WsResponse>
Input Parameters
None
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse> | Successful callback |
Promise.catch() | Promise<WsResponse> | Failed 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.deleteAllConversationFromLocal()
.then(({ data }) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('deleteAllConversationFromLocal', operationID: string): Promise<void>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID used to locate issues. It should be unique. It's recommended to use the current time combined with a random number. |
Return Results
The
openim-uniapp-polyfill
package makes the function a Promise. When calling, usethen
andcatch
to determine and handle successful or failed callbacks.
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<void> | Successful callback |
Promise.catch() | Promise<CatchResponse> | Failed callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('deleteAllConversationFromLocal', IMSDK.uuid())
.then(({ data }) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.hideAllConversations(operationID: string): Promise<void>
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<WsResponse> | Callback on successful call |
Promise.catch() | Promise<WsResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.hideAllConversations('operationID')
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});