SDKsAndroid
Reject a group application
Use the Android SDK to reject a user’s application to join a group.
Group owners and administrators can reject a user's application to join a group. To reject the request, specify the target group ID, the applicant's user ID, and an optional rejection reason.
Code example
String groupID = "group_123";
String applicantUserID = "user_applicant";
String handleMsg = "The group has reached its maximum member capacity.";
OpenIMClient.getInstance().groupManager.refuseGroupApplication(
new OnBase<String>() {
@Override
public void onSuccess(String data) {
// Group application rejected successfully
}
@Override
public void onError(int code, String error) {
// Failed to reject group application
}
},
groupID,
applicantUserID,
handleMsg
);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
base | OnBase<String> | Yes | Callback handler for the asynchronous request. |
groupID | String | Yes | Globally unique ID of the target group. |
applicantUserID | String | Yes | User ID of the applicant requesting to join. |
handleMsg | String | No | Optional rejection reason or explanation. Pass an empty string if not needed. |
Return value
Upon success, data in onSuccess returns a confirmation message.
State changes after the call
- Callback confirmation: The
onSuccesscallback indicates that the server has processed the rejection and updated the application record. - Asynchronous event delivery: The SDK triggers the
onGroupApplicationRejectedevent on affected clients, delivering the updatedGroupApplicationInfo. The client should merge or update the application record usinggroupID:userIDas the unique key. - Re-query calibration: If application state or counts diverge after network reconnections, call
getGroupApplicationListAsRecipient()to reconcile local records with the server.
For complete listener registration and lifecycle management, see Group overview.
Was this page helpful?