hideConversation
Feature Introduction
Description
Hides a local conversation without deleting messages within the conversation. The conversation will be displayed again upon receiving a new message.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future hideConversation({
required String conversationID,
String? operationID,
})
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
conversationID | String | Yes | Conversation ID |
Return Results
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 | Mandatory | Description |
---|---|---|---|
conversationID | NSString | Yes | Conversation ID |
Return Results
Name | Type | Description |
---|---|---|
onSuccess | OIMSuccessCallback | Successful return |
onFailure | OIMFailureCallback | Failed 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 | Mandatory | 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 | Mandatory | Description |
---|---|---|---|
conversationID | string | Yes | Conversation ID |
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.hideConversation('conversationID')
.then(({ data }) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('hideConversation', operationID: string, conversationID: string): Promise<void>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID for problem location, unique, suggested to use current time and a random number |
conversationID | string | Yes | Conversation ID |
Return Results
The
openim-uniapp-polyfill
package Promise-izes the function. When calling, usethen
andcatch
to determine and handle successful and failed callbacks respectively.
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('hideConversation', IMSDK.uuid(), 'conversationID')
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.hideConversation(conversationID: string, operationID: string): Promise<void>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
conversationID | string | Yes | Conversation 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<WsResponse> | Callback on successful call |
Promise.catch() | Promise<WsResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.hideConversation('conversationID', 'operationID')
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});