deleteConversationAndDeleteAllMsg
Feature Introduction
Note
Deletes the specified conversation and its messages from both local and server.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<dynamic> deleteConversationAndDeleteAllMsg({
required String conversationID,
String? operationID,
})
Input Parameters
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
conversationID | String | Yes | Conversation ID |
Return Value
Name | Type | Description |
---|---|---|
~ | ~ | Successful if no exceptions are thrown |
Sample Code
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 | Data Type | Mandatory | Description |
---|---|---|---|
conversationID | NSString | Yes | Conversation ID |
Return Value
Name | Type | Description |
---|---|---|
onSuccess | OIMSuccessCallback | Successful return |
onFailure | OIMFailureCallback | Failed return |
Sample Code
[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 | Data Type | Mandatory | Description |
---|---|---|---|
base | OnBase | Yes | Callback interface |
conversationID | String | Yes | Conversation ID |
Sample Code
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 | Data Type | Mandatory | Description |
---|---|---|---|
conversationID | string | Yes | Conversation ID |
Return Value
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse> | Successful callback |
Promise.catch() | Promise<WsResponse> | Failed callback |
Sample Code
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.deleteConversationAndDeleteAllMsg('conversationID')
.then(({ data }) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('deleteConversationAndDeleteAllMsg', operationID: string, conversationID: string): Promise<void>
Input Parameters
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID for problem tracking, unique recommended with current time and random number |
conversationID | string | Yes | Conversation ID |
Return Value
The function is Promise-converted via
openim-uniapp-polyfill
package. When calling, usethen
andcatch
to determine and handle successful and failed callbacks.
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<void> | Successful callback |
Promise.catch() | Promise<CatchResponse> | Failed callback |
Sample Code
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi(
'deleteConversationAndDeleteAllMsg',
IMSDK.uuid(),
'conversationID'
)
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.deleteConversationAndDeleteAllMsg(operationID: string, conversationID: string): Promise<void>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used for problem location, keep unique, suggest using current time and random number |
conversationID | string | Yes | conversation ID |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<void> | Callback on successful call |
Promise.catch() | Promise<Response> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.deleteConversationAndDeleteAllMsg("conversationID", 'operationID')
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
public static void DeleteConversationAndDeleteAllMsg(OnBase<bool> cb, string conversationId)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
cb | OnBase | Yes | Callback |
conversationID | string | Yes | Conversation ID |
Code Example
IMSDK.DeleteConversationAndDeleteAllMsg((suc,errCode,errMsg)=>{
},conversationId);