Browse SDKs · Android
SDKsAndroid

Apply to join a group

Use the Android SDK to submit a group application or join request.

Copy

Use joinGroup() to submit a request to join a group. joinSource identifies how the user joined: 2 for an invitation, 3 for search, or 4 for a QR code. Use the five-parameter overload when attaching extra data.

OpenIMClient.getInstance().groupManager.joinGroup(new OnBase<String>() {
    @Override public void onSuccess(String data) { /* The request was submitted. */ }
    @Override public void onError(int code, String error) { /* code and error describe the failure. */ }
}, groupID, "I would like to join the project discussion", 3, "{\"from\":\"search\"}");

The verification mode determines whether the user joins immediately or submits an application first. When approval is required, a successful callback means only that the application was submitted. After the user joins, onJoinedGroupAdded provides the joined group's GroupInfo; add it to the current user's group list by groupID. See Group overview for the complete listener setup.