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

Check group membership

Verify whether the authenticated user has joined a specified group.

Copy

Invoke isJoinGroup() to quickly verify whether the authenticated user is an active member of a specified group before displaying group actions or unlocking messaging interfaces.

Parameters

ParameterTypeRequiredDescription
groupIDstringYesTarget group identifier.

Code example

import { isJoinGroup } from '@/uni_modules/unix-openim-sdk'

const joined = await isJoinGroup(groupID)
if (joined == true) {
  showGroupMemberActions()
}

Return value

The Promise resolves with a boolean | null value: true indicates the user is a member, while false indicates non-membership. Do not treat null as confirmed membership.

State changes after the call

This is a local snapshot check that does not emit events. Maintain live membership state across screens by monitoring group addition, quit, and dismissal events indexed by groupID as documented in Group overview. Re-query after network recovery to calibrate.