hideConversation
Description
info
Hide a local conversation. This will not delete the messages within the conversation. When a new message is received, the conversation will be displayed again.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron
- React-Native
- Unity
Function Prototype
Future hideConversation({
required String conversationID,
String? operationID,
})
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | String | Yes | Conversation ID |
Return Result
| Name | Type | Description |
|---|---|---|
| ~ | ~ | Operation successful if no exception thrown |
Code Example
await OpenIM.iMManager.conversationManager.hideConversation(conversationID: conversationID, isPinned: isPinned);
//todo
Function Prototype
- (void)hideConversation:(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 hideConversation:@""
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void hideConversation(OnBase<String> base, String conversationID)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| base | OnBase<String> | Yes | Callback interface |
| conversationID | String | Yes | Conversation ID |
Code Example
OpenIMClient.getInstance().conversationManager.hideConversation(new OnBase<String>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(String data) {
}
},conversationID);
Function Prototype
IMSDK.hideConversation(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.hideConversation('conversationID')
.then(({ data }) => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
IMSDK.asyncApi('hideConversation', 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('hideConversation', IMSDK.uuid(), 'conversationID')
.then(() => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
OpenIMSDK.hideConversation(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.hideConversation('conversationID')
.then(() => {
// Call successful
})
.catch((error) => {
// Call failed
});
Function Prototype
public static void HideConversation(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.HideConversation((suc,errCode,errMsg)=>{
},conversationId);