acceptGroupApplication
Function Description
Note
The group owner or admin approves the group joining request. After approval, the applicant will join the group.
Warning
Once the request to join the group is accepted, neither the admin nor the group owner can make further operations.
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 | Mandatory | Description |
---|---|---|---|
groupID | String | Yes | Group ID |
userID | Sting | Yes | ID of the user initiating the request |
handleMsg | Sting | No | Remark |
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
~ | ~ | Successful if no exceptions are 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 | Mandatory | Description |
---|---|---|---|
groupID | NSString | Yes | Group ID |
fromUserID | NSSting | Yes | ID of the user initiating the request |
handleMsg | NSSting | No | Message |
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
onSuccess | OIMSuccessCallback | Successful return |
onFailure | OIMFailureCallback | Failed return |
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 | Mandatory | Description |
---|---|---|---|
callBack | OnBase | Yes | Callback interface |
gid | String | Yes | Group ID |
uid | String | Yes | User ID |
handleMsg | String | No | Message |
Return Results
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 | Mandatory | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
fromUserID | string | Yes | ID of the user initiating the request |
handleMsg | string | Yes | Operational information |
Return Results
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 { OpenIMSDK } from 'open-im-sdk';
// const IMSDK = new OpenIMSDK();
IMSDK.acceptGroupApplication({
groupID: '',
fromUserID: '',
handleMsg: '',
})
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('acceptGroupApplication', operationID: string, {
groupID: string;
fromUserID: string;
handleMsg: string;
}): Promise<void>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, for troubleshooting, unique, recommended to use current time with a random number |
groupID | string | Yes | Group ID |
fromUserID | string | Yes | ID of the user initiating the request |
handleMsg | string | Yes | Operational information |
Return Results
The function is made Promise-based through the
openim-uniapp-polyfill
package. When called, usethen
andcatch
to handle success and failure respectively.
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(() => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
OpenIMSDKRN.acceptGroupApplication({
groupID: string,
fromUserID: string,
handleMsg: string,
}, operationID: string): Promise<void>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
fromUserID | string | Yes | ID of the user initiating the request |
handleMsg | string | Yes | Operational information |
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<void> | Callback on successful call |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.acceptGroupApplication({
groupID: '',
fromUserID: '',
handleMsg: '',
}, 'operationID')
.then(() => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
public static void AcceptGroupApplication(OnBase<bool> cb, string groupId, string fromUserId, string handleMsg)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
cb | OnBase | Yes | Callback |
groupId | String | Yes | Group ID |
fromUserId | String | Yes | ID of the user initiating the request |
handleMsg | String | Yes | Operational information |
Return Result
Code Example
IMSDK.AcceptGroupApplication((suc,errCode,errMsg)=>{
},gid,uid,handleMsg);