acceptGroupApplication
Description
info
The group owner or administrator accepts the group application.
Note
After the group application is approved, the administrator and group owner can no longer operate.
Related Callbacks:
onGroupApplicationAccepted
onGroupMemberAdded
onJoinedGroupAdded
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<dynamic> acceptGroupApplication({
required String groupID,
required String userID,
String? handleMsg,
String? operationID,
})
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| groupID | String | Yes | Group ID |
| userID | Sting | Yes | Applicant's User ID |
| handleMsg | Sting | No | Remark |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| ~ | ~ | Operation successful if no exception thrown |
Code Example
await OpenIM.iMManager.groupManager.acceptGroupApplication(
groupID: 'groupID',
userID: 'userID',
handleMsg: 'haha',
);
// todo
Function Prototype
- (void)acceptGroupApplication:(NSString *)groupID
fromUserId:(NSString *)fromUserID
handleMsg:(NSString * _Nullable)handleMsg
onSuccess:(nullable OIMSuccessCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| groupID | NSString | Yes | Group ID |
| fromUserID | NSSting | Yes | Applicant's User ID |
| handleMsg | NSSting | No | Message |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| onSuccess | OIMSuccessCallback | Success |
| onFailure | OIMFailureCallback | Failure |
Code Example
[OIMManager.manager acceptGroupApplication:@""
fromUserId:@""
handleMsg:@""
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void acceptGroupApplication(OnBase<String> callBack, String gid, String uid, String handleMsg)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| callBack | OnBase | Yes | Callback interface |
| gid | String | Yes | Group ID |
| uid | String | Yes | User ID |
| handleMsg | String | No | Message |
Return Result
Code Example
OpenIMClient.getInstance().groupManager.acceptGroupApplication(new OnBase<String>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(String data) {
}
},gid,uid,handleMsg)
Function Prototype
IMSDK.acceptGroupApplication({
groupID: string;
fromUserID: string;
handleMsg: string;
}, operationID?: string): Promise<WsResponse>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| groupID | string | Yes | Group ID |
| fromUserID | string | Yes | Applicant's User ID |
| handleMsg | string | Yes | Operational message |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<WsResponse> | Success callback |
| 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.acceptGroupApplication({
groupID: '',
fromUserID: '',
handleMsg: '',
})
.then(() => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
IMSDK.asyncApi('acceptGroupApplication', operationID: string, {
groupID: string;
fromUserID: string;
handleMsg: string;
}): Promise<void>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | Yes | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
| groupID | string | Yes | Group ID |
| fromUserID | string | Yes | Applicant's User ID |
| handleMsg | string | Yes | Operational message |
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<void> | Success callback |
| Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('acceptGroupApplication', IMSDK.uuid(), {
groupID: '',
fromUserID: '',
handleMsg: '',
})
.then(() => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
OpenIMSDK.acceptGroupApplication({
groupID: string,
fromUserID: string,
handleMsg: string,
}, operationID?: string): Promise<void>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| groupID | string | Yes | Group ID |
| fromUserID | string | Yes | Applicant's User ID |
| handleMsg | string | Yes | Operational message |
| operationID | string | No | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<void> | Success callback |
| Promise.catch() | Promise<OpenIMApiError> | Failure callback |
Code Example
import OpenIMSDK from "@openim/rn-client-sdk";
OpenIMSDK.acceptGroupApplication({
groupID: '',
fromUserID: '',
handleMsg: '',
})
.then(() => {
// Success
})
.catch((error) => {
// Failure
});
Function Prototype
public static void AcceptGroupApplication(OnBase<bool> cb, string groupId, string fromUserId, string handleMsg)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| cb | OnBase | Yes | Callback interface |
| groupID | string | Yes | Group ID |
| fromUserID | string | Yes | User ID |
| handleMsg | string | No | Message |
Return Result
Code Example
IMSDK.AcceptGroupApplication((suc,errCode,errMsg)=>{
},gid,uid,handleMsg);