getSpecifiedGroupsInfo
Description
info
Get the specified group information.
Note
It is recommended that the group list is a maximum of 100 at a time.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<GroupInfo>> getGroupsInfo({
required List<String> groupIDList,
String? operationID,
})
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| groupIDList | List<String> | Yes | List of Group IDs |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| ~ | List<GroupInfo> | Success |
Code Example
List<GroupInfo> list = await OpenIM.iMManager.groupManager.getGroupsInfo(
groupIDList: [],
);
// todo
Function Prototype
- (void)getSpecifiedGroupsInfo:(NSArray <NSString *> *)groupsID
onSuccess:(nullable OIMGroupsInfoCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| groupsID | NSArray <NSString *> | Yes | List of Group IDs |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| onSuccess | NSArray< OIMGroupInfo *> | Success |
| onFailure | OIMFailureCallback | Failure |
Code Example
[OIMManager.manager getSpecifiedGroupsInfo:@[]
onSuccess:^(NSArray<OIMGroupInfo *> * _Nullable groupsInfo) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void getGroupsInfo(OnBase<List<GroupInfo>> base, List<String> gidList)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| callBack | OnBase<List<GroupInfo>> | Yes | Callback interface |
| gidList | List<String> | Yes | List of Group IDs |
Return Result
Code Example
OpenIMClient.getInstance().groupManager.getGroupsInfo(new OnBase<List<GroupInfo>>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(List<GroupInfo> data) {
}
},gidList);
Function Prototype
IMSDK.getSpecifiedGroupsInfo(groupIDList: string[], operationID?: string): Promise<WsResponse<GroupInfo[]>>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| groupIDList | string[] | Yes | List of Group IDs |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<WsResponse<GroupInfo[]>> | Group information 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();
const groupIDList = ['userID1', 'userID2'];
IMSDK.getSpecifiedGroupsInfo(groupIDList)
.then(({ data }) => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
IMSDK.asyncApi('getSpecifiedGroupsInfo', operationID: string, groupIDList: string[]): Promise<GroupInfo[]>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | Yes | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
| groupIDList | string[] | Yes | List of Group IDs |
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<GroupInfo[]> | Group information list |
| Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
const groupIDList = ['groupID1', 'groupID2'];
IMSDK.asyncApi('getSpecifiedGroupsInfo', IMSDK.uuid(), groupIDList)
.then((data) => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
OpenIMSDK.getSpecifiedGroupsInfo(groupIDList: string[], operationID?: string): Promise<GroupInfo[]>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | No | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
| groupIDList | string[] | Yes | List of Group IDs |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<GroupInfo[]> | Group information list |
| Promise.catch() | Promise<OpenIMApiError> | Failure callback |
Code Example
import OpenIMSDK from "@openim/rn-client-sdk";
const groupIDList = ['userID1', 'userID2'];
OpenIMSDK.getSpecifiedGroupsInfo(groupIDList)
.then((data) => {
// Success
})
.catch((error) => {
// Failure
});
Function Prototype
public static void GetSpecifiedGroupsInfo(OnBase<List<GroupInfo>> cb, string[] groupIdList)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| cb | OnBase<List<GroupInfo>> | Yes | Callback |
| groupIdList | string[] | Yes | List of Group IDs |
Return Result
Code Example
IMSDK.GetSpecifiedGroupsInfo((list,errCode,errMsg)=>{
},{""});