refuseGroupApplication
Feature Introduction
Description
Deny group membership application.
Caution
(1) Only the group owner or group administrator can call this; (2) Once the group membership request is rejected, administrators and the group owner cannot operate further.
Related Callback: onGroupApplicationRejected
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<dynamic> refuseGroupApplication({
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 | Applicant's userID |
handleMsg | Sting | No | Reason for denial |
Return Value
Parameter Name | Parameter Type | Description |
---|---|---|
~ | ~ | No exception means operation succeeded |
Code Example
await OpenIM.iMManager.groupManager.refuseGroupApplication(
groupID: '',
userID: '',
handleMsg: '',
);
// todo
Function Prototype
- (void)refuseGroupApplication:(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 | Applicant's userID |
handleMsg | NSSting | No | Reason for denial |
Return Value
Parameter Name | Parameter Type | Description |
---|---|---|
onSuccess | OIMSuccessCallback | Successful return |
onFailure | OIMFailureCallback | Failure return |
Code Example
[OIMManager.manager refuseGroupApplication:@""
fromUserId:@""
handleMsg:@""
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void refuseGroupApplication(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 | Sting | Yes | Denied user ID |
handleMsg | Sting | No | Message |
Return Value
Code Example
OpenIMClient.getInstance().groupManager.refuseGroupApplication(new OnBase<String>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(String data) {
}
},gid,uid,handleMsg);
Function Prototype
IMSDK.refuseGroupApplication({
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 | Applicant's userID |
handleMsg | string | Yes | Reason for denial |
Return Value
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.refuseGroupApplication({
groupID: '',
fromUserID: '',
handleMsg: '',
})
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('refuseGroupApplication', operationID: string, {
groupID: string;
fromUserID: string;
handleMsg: string;
}): Promise<void>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, for problem tracking, should be unique, recommended to use current time and random number |
groupID | string | Yes | Group ID |
fromUserID | string | Yes | Applicant's userID |
handleMsg | string | Yes | Reason for denial |
Return Value
Use
openim-uniapp-polyfill
package to promise the function, you need to usethen
andcatch
to determine and handle success and failure callbacks when calling.
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('refuseGroupApplication', IMSDK.uuid(), {
groupID: '',
fromUserID: '',
handleMsg: '',
})
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.refuseGroupApplication({
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 | Applicant's userID |
handleMsg | string | Yes | Reason for denial |
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.refuseGroupApplication({
groupID: '',
fromUserID: '',
handleMsg: '',
}, 'operationID')
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
public static void RefuseGroupApplication(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 | sting | Yes | Applicant's userID |
handleMsg | sting | No | Reason for denial |
Return Result
Code Example
IMSDK.RefuseGroupApplication((suc,errCode,errMsg)=>{
},gid,uid,handleMsg);