getJoinedGroupList
Feature Introduction
Note
Fetch the list of groups you've joined.
Warning
If a joined group has been disbanded, it won't appear in the returned list.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Signature
Future<List<GroupInfo>> getJoinedGroupList({String? operationID})
Input Parameters
None
Return Results
Parameter Name | Data Type | Description |
---|---|---|
~ | List<GroupInfo> | Successful return |
Code Example
List<GroupInfo> list = await OpenIM.iMManager.groupManager.getJoinedGroupList();
// todo
Function Signature
- (void)getJoinedGroupListWithOnSuccess:(nullable OIMGroupsInfoCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
None
Return Results
Parameter Name | Data Type | Description |
---|---|---|
onSuccess | NSArray< OIMGroupInfo *> | Successful return |
onFailure | OIMFailureCallback | Failed return |
Code Example
[OIMManager.manager getJoinedGroupListWithOnSuccess:^(NSArray<OIMGroupInfo *> * _Nullable groupsInfo) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Signature
public void getJoinedGroupList(OnBase<List<GroupInfo>> callBack)
Input Parameters
Parameter Name | Data Type | Required | Description |
---|---|---|---|
callBack | OnBase<List<GroupInfo>> | Yes | Callback Interface |
Return Results
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 Signature
IMSDK.getJoinedGroupList(operationID?: string): Promise<WsResponse<GroupItem[]>>
Input Parameters
None
Return Results
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse<GroupItem[]>> | Joined group list |
Promise.catch() | Promise<WsResponse> | Failed call 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()
.then(({ data }) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Signature
IMSDK.asyncApi('getJoinedGroupList', operationID: string): Promise<GroupItem[]>
Input Parameters
Parameter Name | Data Type | Required | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used to locate issues, should be unique, recommend using current time and a random number |
Return Results
Using the
openim-uniapp-polyfill
package makes the function Promise-based. When calling, usethen
andcatch
to determine and handle successful and failed callbacks.
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<GroupItem[]> | Joined group list |
Promise.catch() | Promise<CatchResponse> | Failed call callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getJoinedGroupList', IMSDK.uuid())
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.getJoinedGroupList(operationID: string): Promise<GroupItem[]>
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<GroupItem[]> | Joined group list |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.getJoinedGroupList('operationID')
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});