Browse SDKs · uni-app / uni-app x
Platform
SDKsuni-app / uni-app xIncludes Enterprise features

Get received group applications

Query group join applications that the authenticated user has authority to review.

Copy

Group owners and administrators invoke getGroupApplicationListAsRecipient() to query incoming join applications requiring review or previously handled. This API provides offset-based pagination; it does not filter by groupID or review outcome.

Parameters

The parameters object can be omitted. When paginating, supply the following fields:

ParameterTypeRequiredDescription
offsetnumberNoPagination offset index; pass 0 for the first page.
countnumberNoNumber of application records to fetch.

Code example

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

const result = await getGroupApplicationListAsRecipient({
  offset: 0,
  count: 20,
})
const applications = result != null ? result.applications : []

Return value

The Promise resolves with an OpenIMGroupApplicationListResult | null object containing OpenIMGroupApplicationItem[] elements in applications.

Group application fields

FieldTypeDescription
groupIDstringTarget group identifier.
userIDstringApplicant user ID; forms a composite key with groupID.
nicknamestringApplicant nickname preserved in the application log.
userFaceURLstringApplicant avatar URL preserved in the application log.
reqMsgstringJoin application greeting or justification text.
reqTimenumberApplication timestamp in Unix milliseconds.
joinSourceOpenIMGroupJoinSourceHow the applicant requested to join.
inviterUserIDstringUser ID of the inviter; empty for direct self-applications.
handleResultOpenIMApplicationHandleResultReview status: OpenIMApplicationHandleResultUnprocessed (pending), OpenIMApplicationHandleResultAccepted (approved), or OpenIMApplicationHandleResultRejected (declined).
handleUserIDstringUser ID of the administrator who handled the request.
handledMsgstringReviewer notes or explanation.
handledTimenumberProcessing timestamp; invalid while pending.
groupNamestringGroup name preserved in the application log.
groupFaceURLstringGroup avatar preserved in the application log.
groupTypeOpenIMGroupType | nullGroup type code.
ownerUserIDstringGroup owner user ID.
creatorUserIDstringGroup creator user ID.
introductionstringGroup description preserved in the record.
notificationstringGroup announcement preserved in the record.
memberCountnumberGroup member count preserved in the record.
statusOpenIMGroupStatusGroup status preserved in the record.
createTimenumberApplication record creation timestamp in Unix milliseconds.
exstringCustom extension string.
attachedInfostringSDK internal metadata.

Fields stored on application records represent point-in-time snapshots. When current user or group data is required, query those entities through their dedicated APIs.

Monitor group application updates

Group join application events and badge updates are centrally managed here. Application events return OpenIMGroupApplicationItem | null objects merged by groupID:userID; the badge event returns the total pending count:

import {
  OpenIMGroupApplicationItem,
  off,
  onGroupApplicationAccepted,
  onGroupApplicationAdded,
  onGroupApplicationBadgeCountChanged,
  onGroupApplicationDeleted,
  onGroupApplicationRejected,
} from '@/uni_modules/unix-openim-sdk'

const mergeApplication = (application: OpenIMGroupApplicationItem | null) => {
  if (application == null) return
  mergeGroupApplication(application)
}

const deleteApplication = (application: OpenIMGroupApplicationItem | null) => {
  if (application == null) return
  removeGroupApplication(application.groupID, application.userID)
}

const updateBadge = (count: number) => {
  setGroupApplicationBadge(count)
}

const addedSubscription = onGroupApplicationAdded(mergeApplication)
const acceptedSubscription = onGroupApplicationAccepted(mergeApplication)
const rejectedSubscription = onGroupApplicationRejected(mergeApplication)
const deletedSubscription = onGroupApplicationDeleted(deleteApplication)
const badgeSubscription = onGroupApplicationBadgeCountChanged(updateBadge)

function removeGroupApplicationListeners() {
  off(addedSubscription)
  off(acceptedSubscription)
  off(rejectedSubscription)
  off(deletedSubscription)
  off(badgeSubscription)
}

If applications change during pagination, reset the offset and reload from the beginning. Unregister these listeners when unmounting views, logging out, or switching user accounts.