getConversationListSplit
Description
info
Get a list of conversations with pagination.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<ConversationInfo>> getConversationListSplit({
int offset = 0,
int count = 20,
String? operationID,
})
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| offset | int | Yes | Start index for paginated fetch |
| count | int | Yes | Number of items per page |
Return Result
| Name | Type | Description |
|---|---|---|
| ~ | List<ConversationInfo> | Success return |
Code Example
List<ConversationInfo> list = await OpenIM.iMManager.conversationManager.getConversationListSplit();
//todo
Function Prototype
- (void)getConversationListSplitWithOffset:(NSInteger)offset
count:(NSInteger)count
onSuccess:(nullable OIMConversationsInfoCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| offset | NSInteger | Yes | Start index for paginated fetch |
| count | NSInteger | Yes | Number of items per page |
Return Result
| Name | Type | Description |
|---|---|---|
| onSuccess | NSArray< OIMConversationInfo *> | Success return |
| onFailure | OIMFailureCallback | Failure return |
Code Example
[OIMManager.manager getConversationListSplitWithOffset:0
count:20
onSuccess:^(NSArray<OIMConversationInfo *> * _Nullable conversations) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void getConversationListSplit(OnBase<List<ConversationInfo>> base, long offset, long count)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| base | OnBase<List<ConversationInfo>> | Yes | Callback interface |
| offset | int | Yes | Start offset value |
| count | int | Yes | Item count |
Code Example
OpenIMClient.getInstance().conversationManager.getConversationListSplit(new OnBase<List<ConversationInfo>>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(List<ConversationInfo> data) {
}
},offset,count);
Function Prototype
IMSDK.getConversationListSplit({
offset: number;
count: number;
},operationID?: string): Promise<WsResponse<ConversationItem[]>>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| offset | number | Yes | Start index for paginated fetch |
| count | number | Yes | Number of items per page |
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.getConversationListSplit({
offset: 0,
count: 20,
})
.then(({ data }) => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
IMSDK.asyncApi('getConversationListSplit', operationID: string, {
offset: number;
count: number;
}): Promise<ConversationItem[]>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | Yes | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
| offset | number | Yes | Start index for paginated fetch |
| count | number | Yes | Number of items per page |
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('getConversationListSplit', IMSDK.uuid(), {
offset: 0,
count: 20,
})
.then((data) => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
OpenIMSDK.getConversationListSplit({
offset: number,
count: number,
}, operationID?: string): Promise<ConversationItem[]>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| offset | number | Yes | Start index for paginated fetch |
| count | number | Yes | Number of items per page |
| 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.getConversationListSplit({
offset: 0,
count: 20,
})
.then((data) => {
// Call successful
})
.catch((error) => {
// Call failed
});
Function Prototype
public static void GetConversationListSplit(OnBase<List<Conversation>> cb, int offset, int count)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| cb | OnBase<List<Conversation>> | Yes | Callback interface |
| offset | int | Yes | Start offset value |
| count | int | Yes | Item count |
Code Example
IMSDK.GetConversationListSplit((list,errCode,errMsg)=>{
},offset,count);