SDKsAndroid
Accept a group application
Use the Android SDK to accept a user’s application to join a group.
Group owners and administrators can accept an applicant's request to join a group. To process the request, provide the target group ID, the applicant's user ID, and an optional processing note.
Code example
String groupID = "group_123";
String applicantUserID = "user_applicant";
String handleMsg = "Welcome to the group";
OpenIMClient.getInstance().groupManager.acceptGroupApplication(
new OnBase<String>() {
@Override
public void onSuccess(String data) {
// Group application accepted successfully
}
@Override
public void onError(int code, String error) {
// Failed to accept 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 note or explanation for accepting the request. 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 approval and updated the application state. - Asynchronous event delivery: The SDK triggers synchronization events across affected clients:
onGroupApplicationAccepted: Delivers the updatedGroupApplicationInfo. The client should merge or update the application record usinggroupID:userIDas the unique key.onGroupMemberAdded: Delivers the newGroupMembersInfoobject. The client should add the applicant to the local group member cache usinggroupID:userIDas the unique key.- Re-query calibration: If application state or member list counts diverge after intermittent network conditions, call
getJoinedGroupListPage(),getGroupMemberList(), orgetGroupApplicationListAsRecipient()to reconcile local state with the server.
For complete listener registration and lifecycle management, see Group overview.
Was this page helpful?