getAllConversationList
Description
info
Get a list of all conversations.
Note
If the conversation list grows too large, it is recommended to use getConversationListSplit to retrieve it via pagination.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<ConversationInfo>> getAllConversationList(
{String? operationID})
Input Parameters
None
Return Result
| Name | Type | Description |
|---|---|---|
| ~ | List<ConversationInfo> | Success return |
Code Example
List<ConversationInfo> list = await OpenIM.iMManager.conversationManager.getAllConversationList();
//todo
Function Prototype
- (void)getAllConversationListWithOnSuccess:(nullable OIMConversationsInfoCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
None
Return Result
| Name | Type | Description |
|---|---|---|
| onSuccess | NSArray< OIMConversationInfo *> | Success return |
| onFailure | OIMFailureCallback | Failure return |
Code Example
[OIMManager.manager getAllConversationListWithOnSuccess:^(NSArray<OIMConversationInfo *> * _Nullable conversations) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void getAllConversationList(OnBase<List<ConversationInfo>> base)
Input Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| callBack | OnBase<List<ConversationInfo>> | Yes | Callback interface |
Code Example
OpenIMClient.getInstance().conversationManager.getAllConversationList(new OnBase<List<ConversationInfo>>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(List<ConversationInfo> data) {
}
});
Function Prototype
IMSDK.getAllConversationList(operationID?: string): Promise<WsResponse<ConversationItem[]>>
Input Parameters
None
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<WsResponse<ConversationItem[]>> | 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();
// use in mini program
// import { getSDK } from '@openim/client-sdk';
// const IMSDK = getSDK();
IMSDK.getAllConversationList()
.then(({ data }) => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
IMSDK.asyncApi('getAllConversationList', operationID: string): Promise<ConversationItem[]>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | Yes | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
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<ConversationItem[]> | Success callback |
| Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getAllConversationList', IMSDK.uuid())
.then((data) => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
OpenIMSDK.getAllConversationList(operationID?: string): Promise<ConversationItem[]>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | No | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<ConversationItem[]>> | Success callback |
| Promise.catch() | Promise<OpenIMApiError> | Failure callback |
Code Example
import OpenIMSDK from "@openim/rn-client-sdk";
OpenIMSDK.getAllConversationList()
.then((data) => {
// Call successful
})
.catch((error) => {
// Call failed
});
Function Prototype
public static void GetAllConversationList(OnBase<List<Conversation>> cb)
Input Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| cb | OnBase<List<Conversation>> | Yes | Callback function |
Code Example
IMSDK.GetAllConversationList((list,errCode,errMsg)=>{
});