getGroupMemberOwnerAndAdmin
Feature Introduction
Note
Retrieve the group owner and administrators for the specified group.
Attention
(1) The caller must join this group to invoke this method.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<GroupMembersInfo>> getGroupOwnerAndAdmin({
required String groupID,
String? operationID,
})
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
groupID | String | Yes | Group ID |
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
~ | List<GroupMembersInfo> | Successful return |
Code Example
List<GroupMembersInfo> list = await OpenIM.iMManager.groupManager.getGroupOwnerAndAdmin(
groupID: 'groupId',
);
// todo
Function Prototype
- (void)getGroupMemberOwnerAndAdmin:(NSString *)groupID
onSuccess:(nullable OIMGroupMembersInfoCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
groupID | NSString | Yes | Group ID |
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
onSuccess | NSArray< OIMGroupMemberInfo *> | Successful return |
onFailure | OIMFailureCallback | Failed return |
Code Example
[OIMManager.manager getGroupMemberOwnerAndAdmin:@""
onSuccess:^(NSArray<OIMGroupMemberInfo *> * _Nullable groupMembersInfo) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void getGroupMemberOwnerAndAdmin(OnBase<List<GroupMembersInfo>> callBack, String groupID)
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
callBack | OnBase<List<GroupMembersInfo>> | Yes | Callback interface |
groupID | String | Yes | Group ID |
Return Results
Code Example
OpenIMClient.getInstance().groupManager.getGroupMemberOwnerAndAdmin(new OnBase<List<GroupMembersInfo>>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(List<GroupMembersInfo> data) {
}
}, groupID)
Function Prototype
IMSDK.getGroupMemberOwnerAndAdmin(groupID: string, operationID?: string): Promise<WsResponse<GroupMemberItem[]>>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse<GroupMemberItem[]>> | Group member 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 { OpenIMSDK } from 'open-im-sdk';
// const IMSDK = new OpenIMSDK();
IMSDK.getGroupMemberOwnerAndAdmin('groupID')
.then(({ data }) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('getGroupMemberOwnerAndAdmin', operationID: string, groupID: string): Promise<GroupMemberItem[]>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID for issue tracking, recommended using current time and a random number |
groupID | string | Yes | Group ID |
Return Results
The
openim-uniapp-polyfill
package turns the function into a Promise. When calling, you need to usethen
andcatch
to judge and handle successful and failed callbacks.
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<GroupMemberItem[]> | Group member list |
Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getGroupMemberOwnerAndAdmin', IMSDK.uuid(), 'groupID')
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.getGroupMemberOwnerAndAdmin(groupID: string, operationID: string): Promise<GroupMemberItem[]>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
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<GroupMemberItem[]> | Group memberlist |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.getGroupMemberOwnerAndAdmin('groupID', 'operationID')
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
public static void GetGroupMemberOwnerAndAdmin(OnBase<List<GroupMember>> cb, string groupId)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
cb | OnBase<List<GroupMember>> | Yes | Callback |
groupId | string | Yes | Group ID |
Return Result
Code Example
IMSDK.GetGroupMemberOwnerAndAdmin((list,errCode,errMsg)=>{
},"groupID");