getJoinedGroupListPage
Description
info
Get the list of joined groups with pagination. offset is the start index, and count is the number to fetch.
Note
The count should not be too large, otherwise the request time will be too long.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<GroupInfo>> getJoinedGroupListPage({String? operationID, int offset = 0, int count = 40});
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| offset | int | Yes | Start index for paginated pull |
| count | int | Yes | Number of items to pull per page |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| ~ | List< GroupInfo> | Success |
Code Example
List<GroupInfo> list = await OpenIM.iMManager.groupManager.getJoinedGroupListPage();
// todo
Function Prototype
- (void)getJoinedGroupListPageWithOffset:(NSInteger)offset
count:(NSInteger)count
onSuccess:(nullable OIMGroupsInfoCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| offset | int | Yes | Start index for paginated pull |
| count | int | Yes | Number of items to pull per page |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| onSuccess | NSArray< OIMGroupInfo *> | Success |
| onFailure | OIMFailureCallback | Failure |
Code Example
[OIMManager.manager getJoinedGroupListWithOffset:
count:
onSuccess:^(NSArray<OIMGroupInfo *> * _Nullable groupsInfo) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void getJoinedGroupList(OnBase<List<GroupInfo>> callBack)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| callBack | OnBase<List<GroupInfo>> | Yes | Callback interface |
Return Result
Code Example
OpenIMClient.getInstance().groupManager.getJoinedGroupList(new OnBase<List<GroupInfo>>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(List<GroupInfo> data) {
}
});
Function Prototype
IMSDK.getJoinedGroupList({
offset: number;
count: number;
}, operationID?: string): Promise<WsResponse<GroupItem[]>>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| offset | number | Yes | Start index for paginated pull |
| count | number | Yes | Number of items to pull 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<WsResponse<GroupItem[]>> | Joined group list |
| 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.getJoinedGroupList({ offset: 0, count: 1000 })
.then(({ data }) => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
IMSDK.asyncApi('getJoinedGroupList', operationID: string, {
offset: number;
count: number;
}): Promise<GroupItem[]>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| offset | number | Yes | Start index for paginated pull |
| count | number | Yes | Number of items to pull per page |
| 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<GroupItem[]> | Joined group list |
| Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getJoinedGroupList', IMSDK.uuid(), { offset: 0, count: 1000 })
.then((data) => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
OpenIMSDK.getJoinedGroupList({
offset: number;
count: number;
}, operationID?: string): Promise<GroupItem[]>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| offset | number | Yes | Start index for paginated pull |
| count | number | Yes | Number of items to pull 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<GroupItem[]> | Joined group list |
| Promise.catch() | Promise<OpenIMApiError> | Failure callback |
Code Example
import OpenIMSDK from "@openim/rn-client-sdk";
OpenIMSDK.getJoinedGroupList({
offset: 0;
count: 1000;
})
.then((data) => {
// Success
})
.catch((error) => {
// Failure
});
Function Prototype
public static void GetJoinedGroupListPage(OnBase<List<GroupInfo>> cb, int offset, int count)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| cb | OnBase<List<GroupInfo>> | Yes | Callback |
| offset | int | Yes | Start index for paginated pull |
| count | int | Yes | Number of items to pull per page |
Return Result
Code Example
IMSDK.GetJoinedGroupListPage((list,errCode,errMsg)=>{
},0,10);