getAllConversationList
Function Introduction
Description
Retrieve all conversation lists.
Note
If the conversation list is too long, it is recommended to use getConversationListSplit for pagination.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<ConversationInfo>> getAllConversationList(
{String? operationID})
Input Parameters
None
Return Results
Name | Type | Description |
---|---|---|
~ | List<ConversationInfo> | Successful 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 Results
Name | Type | Description |
---|---|---|
onSuccess | NSArray< OIMConversationInfo *> | Successful 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 | Mandatory | Description |
---|---|---|---|
callBack | OnBase<List<ConversationInfo>> | Yes | Callback |
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 Results
Parameter Name | Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse<ConversationItem[]>> | Successful 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 { OpenIMSDK } from 'open-im-sdk';
// const IMSDK = new OpenIMSDK();
IMSDK.getAllConversationList()
.then(({ data }) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('getAllConversationList', operationID: string): Promise<ConversationItem[]>
Input Parameters
Parameter Name | Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, for troubleshooting, unique, suggested use of current time and random number |
Return Results
The function is made Promise-based through the
openim-uniapp-polyfill
package. When calling, you need to usethen
andcatch
to judge and handle successful and failed callbacks.
Parameter Name | Type | Description |
---|---|---|
Promise.then() | Promise<ConversationItem[]> | Successful callback |
Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getAllConversationList', IMSDK.uuid())
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.getAllConversationList(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 |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<ConversationItem[]>> | Callback on successful call |
Promise.catch() | Promise<Response> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.getAllConversationList('operationID')
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
public static void GetAllConversationList(OnBase<List<Conversation>> cb)
Input Parameter
Parameter Name | Parameter Type | Description | |
---|---|---|---|
cb | OnBase<List<Conversation>> | Yes | Callback |
Code Example
IMSDK.GetAllConversationList((list,errCode,errMsg)=>{
});