AI Integration Quick Reference
AI Integration Quick Reference
| Field | Value |
|---|---|
| Package | @cometchat/chat-uikit-react-native |
| Key methods | CometChat.blockUsers(), CometChat.unblockUsers() |
| Init | CometChatUIKit.init(UIKitSettings) then CometChatUIKit.login("UID") |
| Events | CometChatUIEvents.ccUserBlocked, CometChatUIEvents.ccUserUnBlocked |
| Sample app | GitHub |
| Related | Users · Message Composer · All Guides |
Components
| Component / Class | Role |
|---|---|
CometChat.blockUsers() | SDK method to block specific users |
CometChat.unblockUsers() | SDK method to unblock previously blocked users |
CometChatUIEvents.ccUserBlocked | Event fired when a user is blocked |
CometChatUIEvents.ccUserUnBlocked | Event fired when a user is unblocked |
CometChatConfirmDialog | Confirmation dialog for block/unblock actions |
Integration Steps
1. Block User
CallCometChat.blockUsers() with the target UID. On success, emit ccUserBlocked so all subscribed components react to the change.
2. Unblock User
CallCometChat.unblockUsers() with the target UID. On success, emit ccUserUnBlocked to restore the composer.
3. Composer Blocked State
When a user is blocked, replace the composer with an unblock prompt.4. Block Option in User Info
Add a block/unblock option in the user info or details screen.Feature Matrix
| Feature | Component / Method |
|---|---|
| Block user | CometChat.blockUsers([UID]) |
| Unblock user | CometChat.unblockUsers([UID]) |
| Check blocked status | user.getBlockedByMe() |
| Block event | CometChatUIEvents.ccUserBlocked |
| Unblock event | CometChatUIEvents.ccUserUnBlocked |
| Event listener | CometChatUIEventHandler.addUserListener() |
Next Steps
Users
Display and manage user lists.
Message Composer
Customize the message input component.
All Guides
Browse all feature and formatter guides.
Sample App
Full working sample application on GitHub.