deleteConversationAndDeleteAllMsg
Description
info
Delete the designated conversation and all its messages from local and server storage.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron
- React-Native
- Unity
Function Prototype
Future<dynamic> deleteConversationAndDeleteAllMsg({
required String conversationID,
String? operationID,
})
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | String | Yes | Conversation ID |
Return Result
| Name | Type | Description |
|---|---|---|
| ~ | ~ | Deletion successful if no exception is thrown |
Code Example
await OpenIM.iMManager.conversationManager.deleteConversationAndDeleteAllMsg(conversationID: conversationID);
//todo
Function Prototype
- (void)deleteConversationAndDeleteAllMsg:(NSString *)conversationID
onSuccess:(nullable OIMSuccessCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | NSString | Yes | Conversation ID |
Return Result
| Name | Type | Description |
|---|---|---|
| onSuccess | OIMSuccessCallback | Success return |
| onFailure | OIMFailureCallback | Failure return |
Code Example
[OIMManager.manager deleteConversationAndDeleteAllMsg:@""
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void deleteConversationAndDeleteAllMsg(OnBase<String> base, String conversionID)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| base | OnBase | Yes | Callback interface |
| conversationID | String | Yes | Conversation ID |
Code Example
OpenIMClient.getInstance().conversationManager.deleteConversationAndDeleteAllMsg(new OnBase<String>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(String data) {
}
},conversationID);
Function Prototype
IMSDK.deleteConversationAndDeleteAllMsg(conversationID: string, operationID?: string): Promise<WsResponse>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | string | Yes | Conversation ID |
Return Result
| Parameter Name | Parameter 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();
IMSDK.deleteConversationAndDeleteAllMsg('conversationID')
.then(({ data }) => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
IMSDK.asyncApi('deleteConversationAndDeleteAllMsg', operationID: string, conversationID: string): Promise<void>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | Yes | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
| conversationID | string | Yes | Conversation ID |
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<void> | Success callback |
| Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi(
'deleteConversationAndDeleteAllMsg',
IMSDK.uuid(),
'conversationID'
)
.then(() => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
OpenIMSDK.deleteConversationAndDeleteAllMsg(conversationID: string, operationID?: string): Promise<void>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | string | Yes | Conversation ID |
| operationID | string | No | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<void> | Success callback |
| Promise.catch() | Promise<OpenIMApiError> | Failure callback |
Code Example
import OpenIMSDK from "@openim/rn-client-sdk";
OpenIMSDK.deleteConversationAndDeleteAllMsg("conversationID")
.then(() => {
// Call successful
})
.catch((error) => {
// Call failed
});
Function Prototype
public static void DeleteConversationAndDeleteAllMsg(OnBase<bool> cb, string conversationId)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| cb | OnBase | Yes | Callback interface |
| conversationId | string | Yes | Conversation ID |
Code Example
IMSDK.DeleteConversationAndDeleteAllMsg((suc,errCode,errMsg)=>{
},conversationId);