Browse SDKs · uni-app / uni-app x
SDKsuni-app

Apply to join a group

OpenIM uni-app / uni-app x SDK guide for Apply to join a group.

Copy

joinGroup() submits the current user's request to join a group.

Parameters

ParameterTypeRequiredDescription
groupIDstringYesGroup to join.
reqMsgstringYesApplication comment, which can be shown to owners or administrators.
joinSourcenumberYesJoin-source value agreed by the product and server.
exstring or nullNoApplication extension; use only a confirmed format.
import { joinGroup } from '@/uni_modules/unix-openim-sdk'

await joinGroup({ groupID, reqMsg: 'Please add me', joinSource: 2, ex: '' })

The application comment and ex can be stored with the application. Do not include tokens, internal risk information, or unnecessary personal data. Verify that the group exists and the current user is not already a member.

Promise success does not always mean membership. A no-verification group can join directly, while another policy creates a pending application. Determine final state from application events, onJoinedGroupAdded, or a new joined-group query. Never create local member state before the server confirms it.