SDKsWASM
Apply to join a group
Apply to join a group, or join directly when approval is not required.
joinGroup() submits a join request with a group ID, application message, and join source.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | Target group ID. |
reqMsg | string | Yes | Application message. Pass an empty string when there is none. |
joinSource | GroupJoinSource | Yes | How the user initiated the join. |
ex | string | No | Application extension string. |
| Enum value | Numeric value | Meaning |
|---|---|---|
GroupJoinSource.Invitation | 2 | Joined through an invitation. |
GroupJoinSource.Search | 3 | Joined through search. |
GroupJoinSource.QrCode | 4 | Joined through a QR code. |
import { GroupJoinSource } from '@openim/wasm-client-sdk';
await openimsdk.joinGroup({
groupID,
reqMsg: 'Please add me to the project discussion group',
joinSource: GroupJoinSource.Search,
});joinSource records only the path used to join and does not determine whether approval is required. When approval is required, a successful Promise means only that the application was submitted. Update the joined-group list from OnJoinedGroupAdded only after the account actually joins. See Group overview for complete event handling.
Was this page helpful?