AI Integration Quick Reference
AI Integration Quick Reference
- Create Group
- Join Group
- View Members
- Add Member
- Ban Member
- Change Member Scope
- Transfer Ownership
Overview
A user can create or join a group, then open a dialog to:- View current members.
- Add or ban participants.
- Change member roles (e.g., member, moderator).
- Delegate group ownership.
Prerequisites
- Android Studio project with CometChat Android UI Kit v5 (
com.cometchat:chatuikit-kotlinorcom.cometchat:chatuikit-jetpack) and CometChat Chat SDK inbuild.gradle. - Internet permission in
AndroidManifest.xml. - Valid CometChat App ID, Region, and Auth Key configured via
UIKitSettings. - User logged in with
CometChatUIKit.login(). - A
MessagesActivity(orConversationActivity) and an optionalGroupDetailsActivityin your flow.
Components
Integration Steps
1. Layout/UI Setup
Add a FAB to launch the group-management dialog.2. Wiring UI in Activity
Initialize UIKit views and respond to FAB clicks.- Kotlin (XML Views)
- Jetpack Compose
MessagesActivity.kt
3. Create & Join Group
Allow users to create or join a group via Core SDK.- Kotlin (XML Views)
- Jetpack Compose
4. View Group Members
Fetch and display the current member list.- Kotlin (XML Views)
- Jetpack Compose
5. Add Member
Select users not in the group and add them.6. Ban Member, Change Scope & Transfer Ownership
Perform moderation actions on selected members.Implementation Flow Summary
Customization Options
- Use a BottomSheetDialog instead of a standard dialog.
- Implement multi-select for bulk actions (e.g., add multiple members).
- Replace default dialogs with custom RecyclerView lists or Compose
LazyColumn. - Control permissions: show options only to admins or owners.
Error Handling & Edge Cases
- Not in Group: Disable join option if user is already member.
- Permission Denied: Only show ban/transfer options to group admins.
- Empty Lists: Display an empty-state view if no members or users.
- Pagination: Implement
fetchNext()in scroll listeners for large groups.
Feature Matrix
Android Sample App (Kotlin)
Explore this feature in the CometChat SampleApp:
GitHub → SampleApp