Browse SDKs · React Native
SDKsReact Native

Apply to join a group

OpenIM React Native SDK guide for apply to join a group.

Copy

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 valueValueDescription
GroupJoinSource.Invitation2Joined through an invitation.
GroupJoinSource.Search3Joined through search.
GroupJoinSource.QrCode4Joined 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.