SDKsReact Native
Join a group
Apply to join a group with application notes and join source using the OpenIM React Native SDK.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | Target group ID to join. |
reqMsg | string | Yes | Application greeting message; pass empty string "" if not provided. |
joinSource | GroupJoinSource | Yes | Source channel through which the user discovered the group. |
ex | string | No | Custom business extension string. |
GroupJoinSource values:
| Enum value | Value | Description |
|---|---|---|
GroupJoinSource.Invitation | 2 | Joined via an invitation link or prompt. |
GroupJoinSource.Search | 3 | Joined via search results. |
GroupJoinSource.QrCode | 4 | Joined 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.
Was this page helpful?