Browse SDKs · React Native
Platform
SDKsReact Native

Join a group

Apply to join a group with application notes and join source using the OpenIM React Native SDK.

Copy

Submit an application to join a group specified by groupID, providing a greeting message and join source:

await OpenIMSDK.joinGroup({
  groupID,
  reqMsg: 'Applying to join project discussion',
  joinSource: GroupJoinSource.Search,
});

Parameters

ParameterTypeRequiredDescription
groupIDstringYesTarget group ID to join.
reqMsgstringYesApplication greeting message; pass empty string "" if not provided.
joinSourceGroupJoinSourceYesSource channel through which the user discovered the group.
exstringNoCustom business extension string.

GroupJoinSource values:

Enum valueValueDescription
GroupJoinSource.Invitation2Joined via an invitation link or prompt.
GroupJoinSource.Search3Joined via search results.
GroupJoinSource.QrCode4Joined by scanning a group QR code.

joinSource records the acquisition channel; whether verification is required depends on the group's join verification policy.

Return value

A resolved Promise confirms that the join application was submitted to the server.

If the group allows direct entry or an administrator approves the application, the joining user receives the OnJoinedGroupAdded event. Merge the group into your joined group list keyed by groupID. For event listeners, see Group overview.