getConversationListSplit
Function Introduction
Description
Retrieve the conversation list in a paginated manner.
- 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 | Starting index for pagination |
count | int | Yes | Number of items per page |
Return Results
Name | Type | Description |
---|---|---|
~ | List<ConversationInfo> | Successful 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 | Starting index for pagination |
count | NSInteger | Yes | Number of items per page |
Return Results
Name | Type | Description |
---|---|---|
onSuccess | NSArray< OIMConversationInfo *> | Successful return |
onFailure | OIMFailureCallback | Failed 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 | Starting offset |
count | int | Yes | Quantity |
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 | Starting index for pagination |
count | number | Yes | Number of items per page |
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.getConversationListSplit({
offset: 0,
count: 20,
})
.then(({ data }) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
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 for troubleshooting. Keep unique, suggested to use current time and random number |
offset | number | Yes | Starting index for pagination |
count | number | Yes | Number of items per page |
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('getConversationListSplit', IMSDK.uuid(), {
offset: 0,
count: 20,
})
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.getConversationListSplit({
offset: number,
count: number,
}, 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 |
offset | number | Yes | Starting index for pagination |
count | number | Yes | Number of items per page |
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.getConversationListSplit({
offset: 0,
count: 20,
}, 'operationID')
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
public static void GetConversationListSplit(OnBase<List<Conversation>> cb, int offset, int count)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
cb | OnBase<List<Conversation>> | Yes | Callback |
offset | int | Yes | Starting index for pagination |
count | int | Yes | Number of items per page |
Code Example
IMSDK.GetConversationListSplit((list,errCode,errMsg)=>{
},offset,count);