getMultipleConversation
Feature Introduction
Note
Retrieve multiple conversation lists based on specified conversation IDs.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<ConversationInfo>> getMultipleConversation({
required List<String> conversationIDList,
String? operationID,
})
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
conversationIDList | List<String> | Yes | List of conversation IDs |
Return Results
Name | Type | Description |
---|---|---|
~ | List<ConversationInfo> | Successful return |
Code Example
final list = await OpenIM.iMManager.conversationManager.getMultipleConversation(conversationIDList: conversationIDList);
//todo
Function Prototype
- (void)getMultipleConversation:(NSArray <NSString *> *)conversationIDs
onSuccess:(nullable OIMConversationsInfoCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
conversationIDs | NSArray <NSString *> | Yes | List of conversation IDs |
Return Results
Name | Type | Description |
---|---|---|
onSuccess | OIMConversationInfo | Successful return |
onFailure | OIMFailureCallback | Failed return |
Code Example
[OIMManager.manager getMultipleConversation:@[]
onSuccess:^(OIMConversationInfo * _Nullable conversation) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void getMultipleConversation(OnBase<List<ConversationInfo>> base, List<String> conversationIDs)
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
base | OnBase<List<ConversationInfo>> | Yes | Callback interface |
conversationIDs | List<String> | Yes | List of conversation IDs |
Code Example
OpenIMClient.getInstance().conversationManager.getMultipleConversation(new OnBase<List<ConversationInfo>>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(List<ConversationInfo> data) {
}
},conversationIDs);
Function Prototype
IMSDK.getMultipleConversation(conversationIDList: string[],operationID?: string): Promise<WsResponse<ConversationItem[]>>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
conversationIDList | string[] | Yes | List of conversation IDs |
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse<ConversationItem[]>> | 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.getMultipleConversation(['conversationID'])
.then(({ data }) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('getMultipleConversation', operationID: string, conversationIDList: string[]): Promise<ConversationItem[]>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used for troubleshooting. Keep unique, suggested to use current time and random number |
conversationIDList | string[] | Yes | List of conversation IDs |
Return Results
The function is made Promise-based through the
openim-uniapp-polyfill
package. When calling, you need to usethen
andcatch
to determine and handle successful and failed callbacks.
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<ConversationItem[]> | Successful callback |
Promise.catch() | Promise<CatchResponse> | Failed callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getMultipleConversation', IMSDK.uuid(), ['conversationID'])
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.getMultipleConversation({
conversationIDList: string[],
}, operationID: string): Promise<ConversationItem[]>
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 |
conversationIDList | string[] | Yes | List of conversation IDs |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<ConversationItem[]> | Callback on successful call |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.getMultipleConversation(['conversationID'], 'operationID')
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
public static void GetMultipleConversation(OnBase<List<Conversation>> cb, string[] conversationIdList)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
cb | OnBase<List<Conversation>> | Yes | Callback |
conversationIdList | string[] | Yes | List of conversation IDs |
Code Example
IMSDK.GetMultipleConversation((list,errCode,errMsg)=>{
},conversationIdList);