getSpecifiedGroupsInfo
Feature Introduction
Description
Retrieve information about specified groups.
Note
The list of groups is recommended to have 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 | Data Type | Required | Description |
---|---|---|---|
groupIDList | List<String> | Yes | List of Group IDs |
Return Values
Parameter Name | Data Type | Description |
---|---|---|
~ | List<GroupInfo> | Successful Return |
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 | Data Type | Required | Description |
---|---|---|---|
groupsID | NSArray <NSString *> | Yes | List of Group IDs |
Return Values
Parameter Name | Data Type | Description |
---|---|---|
onSuccess | NSArray< OIMGroupInfo *> | Successful Return |
onFailure | OIMFailureCallback | Failed Return |
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 | Data Type | Required | Description |
---|---|---|---|
callBack | OnBase<List<GroupInfo>> | Yes | Callback Interface |
gidList | List<String> | Yes | List of Group IDs |
Return Values
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 | Data Type | Required | Description |
---|---|---|---|
groupIDList | string[] | Yes | List of Group IDs |
Return Values
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse<GroupInfo[]>> | Group Information List |
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 { OpenIMSDK } from 'open-im-sdk';
// const IMSDK = new OpenIMSDK();
const groupIDList = ['userID1', 'userID2'];
IMSDK.getSpecifiedGroupsInfo(groupIDList)
.then(({ data }) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('getSpecifiedGroupsInfo', operationID: string, groupIDList: string[]): Promise<GroupInfo[]>
Input Parameters
Parameter Name | Data Type | Required | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, for troubleshooting. Unique, suggested to use current time and a random number. |
groupIDList | string[] | Yes | List of Group IDs |
Return Values
The function is converted to a Promise via the
openim-uniapp-polyfill
package. Usethen
andcatch
to evaluate and handle successful and failed callbacks.
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<GroupInfo[]> | Group Information List |
Promise.catch() | Promise<CatchResponse> | Failed Callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
const groupIDList = ['userID1', 'userID2'];
IMSDK.asyncApi('getSpecifiedGroupsInfo', IMSDK.uuid(), groupIDList)
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.getSpecifiedGroupsInfo(groupIDList: string[], operationID: string): Promise<GroupInfo[]>
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 |
groupIDList | string[] | Yes | List of group IDs |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<GroupInfo[]> | Group Information List |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
const groupIDList = ['userID1', 'userID2'];
OpenIMSDKRN.getSpecifiedGroupsInfo(groupIDList, 'operationID')
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
public static void GetSpecifiedGroupsInfo(OnBase<List<GroupInfo>> cb, string[] groupIdList)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
cb | OnBase<List<GroupInfo>> | Yes | Callback |
groupIdLIst | string[] | Yes | Array of Group ID |
Return Result
Code Example
IMSDK.GetSpecifiedGroupsInfo((list,errCode,errMsg)=>{
},{""});