Apply to join a group
OpenIM React Native SDK guide for apply to join a group.
Call joinGroup() with a group ID, application message, and join source to apply to join a group.
await OpenIMSDK.joinGroup({
groupID,
reqMsg: 'Request to join the project discussion group',
joinSource: GroupJoinSource.Search,
});Parameters
| Parameter | Type | Required | Description |
| --- | --- | --- |
| groupID | string | Yes | ID of the target group. |
| reqMsg | string | Yes | Application message. Pass an empty string when no message is needed. |
| joinSource | GroupJoinSource | Yes | How the user initiated joining the group. |
| ex | string | No | Business-specific extension string. |
Common joinSource values are:
| Enum value | Value | Description |
|---|---|---|
GroupJoinSource.Invitation | 2 | Joined through an invitation. |
GroupJoinSource.Search | 3 | Joined through search. |
GroupJoinSource.QrCode | 4 | Joined through a QR code. |
joinSource records how the user joined; it does not determine whether approval is required.
Return value
When the call completes, the join request is submitted. After the current account joins the group successfully, OnJoinedGroupAdded returns the group information; see Group overview for event handling.
Was this page helpful?