Get received group applications
Paginate and retrieve incoming group join applications as owner or admin using the OpenIM React Native SDK.
Group owners and administrators can paginate and query join requests received across administered groups, filtering by group IDs and handling statuses:
const applications = await OpenIMSDK.getGroupApplicationListAsRecipient({
groupIDs: ['group-001'],
handleResults: [ApplicationHandleResult.Unprocessed],
offset: 0,
count: 20,
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupIDs | string[] | Yes | List of group IDs to filter by; pass empty array [] to query all administered groups. |
handleResults | number[] | Yes | List of handle statuses to filter by; pass empty array [] to match all. |
offset | number | Yes | Pagination offset starting from 0. |
count | number | Yes | Maximum number of records to retrieve. |
ApplicationHandleResult status values:
| Enum value | Value | Description |
|---|---|---|
ApplicationHandleResult.Unprocessed | 0 | Pending review. |
ApplicationHandleResult.Agree | 1 | Approved. |
ApplicationHandleResult.Reject | -1 | Rejected. |
Return value
Resolves to an array of GroupApplicationItem[] for the requested page. When the returned count is less than count, the end of the list has been reached. Reconcile entries using the composite key groupID:userID.
Group application properties
| Field | Type | Description |
|---|---|---|
groupID | string | Target group ID of the application. |
userID | string | Applicant user ID. |
nickname | string | Applicant nickname at the time of application. |
userFaceURL | string | Applicant avatar image URL at the time of application. |
reqMsg | string | Application greeting message. |
reqTime | number | Timestamp when the application was submitted. |
joinSource | GroupJoinSource | Join discovery channel. |
handleResult | ApplicationHandleResult | Current handling status. |
handleUserID | string | User ID of the operator who processed the request. |
handledMsg | string | Operator note text. |
handledTime | number | Processing timestamp. |
groupName | string | Group name snapshot in the application record. |
groupFaceURL | string | Group avatar URL snapshot in the application record. |
groupType | GroupType | Group type. |
ownerUserID | string | Group owner user ID. |
creatorUserID | string | Group creator user ID. |
introduction | string | Group description snapshot. |
notification | string | Group announcement snapshot. |
memberCount | number | Member count snapshot. |
status | GroupStatus | Group status snapshot. |
createTime | number | Application creation timestamp in Unix milliseconds. |
ex | string | Custom extension string. |
User and group profiles within application records reflect historical snapshots at submission time. To render real-time profiles, query current user or group endpoints separately.
Listen for group application changes
Application mutations trigger OnGroupApplicationAdded, OnGroupApplicationAccepted, OnGroupApplicationRejected, or OnGroupApplicationDeletedEnterprise. Reconcile state items using the composite key groupID:userID:
const handleApplicationChanged = (application: GroupApplicationItem) => {
// Update application matching application.groupID and application.userID
};
const handleApplicationDeleted = (application: GroupApplicationItem) => {
// Remove application matching application.groupID and application.userID
};
// Register listeners
OpenIMSDK.on(OpenIMEvent.OnGroupApplicationAdded, handleApplicationChanged);
OpenIMSDK.on(OpenIMEvent.OnGroupApplicationAccepted, handleApplicationChanged);
OpenIMSDK.on(OpenIMEvent.OnGroupApplicationRejected, handleApplicationChanged);
OpenIMSDK.on(OpenIMEvent.OnGroupApplicationDeleted, handleApplicationDeleted);
// Remove listeners
OpenIMSDK.off(OpenIMEvent.OnGroupApplicationAdded, handleApplicationChanged);
OpenIMSDK.off(OpenIMEvent.OnGroupApplicationAccepted, handleApplicationChanged);
OpenIMSDK.off(OpenIMEvent.OnGroupApplicationRejected, handleApplicationChanged);
OpenIMSDK.off(OpenIMEvent.OnGroupApplicationDeleted, handleApplicationDeleted);Unregister these listeners when the screen unmounts, the user logs out, or accounts switch.
Was this page helpful?