From e58662a395b30df030adbadd73f03a736a6f58fd Mon Sep 17 00:00:00 2001 From: Raj Dubey Date: Fri, 27 Nov 2026 15:57:13 +0530 Subject: [PATCH] docs(ENG-58472): retire superseded orphan pages, put the Unreal SDK pages in nav 251 pages on main are in no navigation. They are live and indexed, so readers and agents land on them, but nobody maintains them. This takes the unambiguous ones. Deleted and redirected (27 files, 23 new redirects): - 6 AI Agents API stubs that document an endpoint the current reference already covers (rest-api/ai-agents-apis/*), matched by OpenAPI operation - sdk/unreal/SAMPLE_APP.md, a repo readme that shipped as a docs URL - 4 files that shadowed an existing redirect: ai-agents/actions, ai-agents/tools, articles/docker, fundamentals/webhooks-overview - 9 legacy Kotlin UI Kit pages -> Android UI Kit - ui-kit/angular/2.0/javascript-2-0-overview, calls/ionic/overview (a "coming soon" stub), articles/calendar-scheduling, articles/rate-limits, campaigns/webhooks, ai-chatbots/custom-agents, sdk/flutter/v5/v5-docs-changelog Added to navigation: the 5 Unreal Engine SDK pages that were written but unreachable - conversations, transient-messages, moderation, ui-components and advanced-configuration. Six in-content links that pointed at a deleted page now point at the live one instead of travelling through a redirect. Not touched, and listed in the PR for a decision: 30 AI Agents API stubs that document endpoints with no page in the current reference, articles/migration-guide (v2 -> v3, no replacement), and 158 legacy web-shared/web-elements pages. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01XbguTwTfLRtzUBLqizkjui --- ai-agents/actions.mdx | 87 -- ai-agents/apis/get-api-tool.mdx | 4 - ai-agents/apis/get-available-models.mdx | 4 - ai-agents/apis/get-frontend-action.mdx | 4 - ai-agents/apis/get-mcp-server.mdx | 4 - ai-agents/apis/get-text-detail.mdx | 4 - ai-agents/apis/list-text-details.mdx | 4 - ai-agents/tools.mdx | 71 -- ai-chatbots/custom-agents.mdx | 60 - articles/calendar-scheduling.mdx | 41 - articles/docker.mdx | 91 -- articles/rate-limits.mdx | 35 - calls/ionic/overview.mdx | 22 - calls/webhooks.mdx | 2 +- campaigns/webhooks.mdx | 13 - docs.json | 107 ++ fundamentals/webhooks-overview.mdx | 176 --- sdk/android/2.0/overview.mdx | 2 +- sdk/android/3.0/overview.mdx | 2 +- sdk/android/v5/llms-android-v5.mdx | 2 +- sdk/flutter/v5/v5-docs-changelog.md | 148 --- sdk/unreal/SAMPLE_APP.md | 230 ---- ui-kit/android/llms-android-v6.mdx | 2 +- ui-kit/android/v3/overview.mdx | 2 +- .../angular/2.0/javascript-2-0-overview.mdx | 5 - ui-kit/kotlin/2.0/customize-ui-kit.mdx | 144 --- ui-kit/kotlin/2.0/key-concepts.mdx | 128 -- .../2.0/message-structure-and-hierarchy.mdx | 72 -- ui-kit/kotlin/2.0/overview.mdx | 272 ---- ui-kit/kotlin/2.0/ui-components.mdx | 1097 ----------------- ui-kit/kotlin/customize-ui-kit.mdx | 138 --- ui-kit/kotlin/key-concepts.mdx | 127 -- ui-kit/kotlin/overview.mdx | 327 ----- ui-kit/kotlin/ui-components.mdx | 1028 --------------- 34 files changed, 113 insertions(+), 4342 deletions(-) delete mode 100644 ai-agents/actions.mdx delete mode 100644 ai-agents/apis/get-api-tool.mdx delete mode 100644 ai-agents/apis/get-available-models.mdx delete mode 100644 ai-agents/apis/get-frontend-action.mdx delete mode 100644 ai-agents/apis/get-mcp-server.mdx delete mode 100644 ai-agents/apis/get-text-detail.mdx delete mode 100644 ai-agents/apis/list-text-details.mdx delete mode 100644 ai-agents/tools.mdx delete mode 100644 ai-chatbots/custom-agents.mdx delete mode 100644 articles/calendar-scheduling.mdx delete mode 100644 articles/docker.mdx delete mode 100644 articles/rate-limits.mdx delete mode 100644 calls/ionic/overview.mdx delete mode 100644 campaigns/webhooks.mdx delete mode 100644 fundamentals/webhooks-overview.mdx delete mode 100644 sdk/flutter/v5/v5-docs-changelog.md delete mode 100644 sdk/unreal/SAMPLE_APP.md delete mode 100644 ui-kit/angular/2.0/javascript-2-0-overview.mdx delete mode 100644 ui-kit/kotlin/2.0/customize-ui-kit.mdx delete mode 100644 ui-kit/kotlin/2.0/key-concepts.mdx delete mode 100644 ui-kit/kotlin/2.0/message-structure-and-hierarchy.mdx delete mode 100644 ui-kit/kotlin/2.0/overview.mdx delete mode 100644 ui-kit/kotlin/2.0/ui-components.mdx delete mode 100644 ui-kit/kotlin/customize-ui-kit.mdx delete mode 100644 ui-kit/kotlin/key-concepts.mdx delete mode 100644 ui-kit/kotlin/overview.mdx delete mode 100644 ui-kit/kotlin/ui-components.mdx diff --git a/ai-agents/actions.mdx b/ai-agents/actions.mdx deleted file mode 100644 index f68466902..000000000 --- a/ai-agents/actions.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: "AI Agent Actions" -sidebarTitle: "Actions" -description: "Explore the various actions you can perform with your AI agent in CometChat." ---- - -## Overview - -Actions allow your AI agent to perform specific, predefined tasks during a conversation. -Each action includes a **name**, **display name**, **execution text**, and optional **parameters** to make the execution dynamic. - -You can create actions to: - -- Trigger workflows or automations. -- Call external APIs. -- Send structured responses to users. -- Execute commands with dynamic inputs. - ---- - -## Creating an Action - -1. **Navigate to AI Agent → Actions** in the CometChat dashboard. -2. Click **Create Action**. - -You will see the following fields: - -### **Display Name** -A human-friendly name shown in the UI. -_Example_: `Create Support Ticket` - -### **Execution Text** -The text prompt shown to the AI when this action is triggered. -_Example_: `Create a Zendesk ticket with the following details.` - -### **Name** -A unique identifier for the action. This is used programmatically and should not contain spaces. -_Example_: `create_support_ticket` - -### **Description** -A short explanation of what the action does. -_Example_: `Creates a support ticket in Zendesk based on user query details.` - -### **Parameters** -A JSON schema that defines what input values the action requires. - -**Important:** The `""` must exactly match the **Tool Name** you created in **AI Agent → Tools**. -This ensures that the Action can send correctly formatted data to the intended Tool. - -Example: -```json -{ - "type": "object", - "properties": { - "": { - "type": "string", - "description": "Description of the parameter, defining the input the tool expects." - } - } -} -``` - -**Parameter Types:** Use standard JSON Schema types like `string`, `number`, `boolean`, `object`, or `array`. - -**Parameter Descriptions:** Clearly explain the purpose and expected format of each parameter. - ---- - -## Example Action: Create Zendesk Ticket - -| Field | Value | -|----------------|-------| -| Display Name | Create Support Ticket | -| Execution Text | Create a Zendesk ticket with the provided details. | -| Name | create_support_ticket | -| Description | Creates a support ticket in Zendesk for user issues. | -| Parameters | See JSON example above | - ---- - -## Best Practices - -- **Keep display names short and clear** – instantly understandable to end users. -- **Use consistent naming** – for the `Name` field, use lowercase with underscores. -- **Match parameter names to tool names** – ensures correct tool invocation. -- **Validate parameters** – always define parameter types and descriptions to prevent AI misinterpretation. -- **Document purpose** – add clear descriptions for developers integrating the action. diff --git a/ai-agents/apis/get-api-tool.mdx b/ai-agents/apis/get-api-tool.mdx deleted file mode 100644 index f5c69aebb..000000000 --- a/ai-agents/apis/get-api-tool.mdx +++ /dev/null @@ -1,4 +0,0 @@ ---- -openapi: get /ai-agents/agent-builder/api-tools/{slug} -description: "Retrieves a specific API tool by its slug. Use this endpoint to inspect an API tool's configuration, parameters, and connected agents." ---- diff --git a/ai-agents/apis/get-available-models.mdx b/ai-agents/apis/get-available-models.mdx deleted file mode 100644 index 2edf4ac85..000000000 --- a/ai-agents/apis/get-available-models.mdx +++ /dev/null @@ -1,4 +0,0 @@ ---- -openapi: get /ai-agents/agent-builder/agents/available-models -description: "Retrieves the list of AI models available for agents. Use this endpoint to discover supported models before creating or updating an agent. **Model details:** Each model includes its provider, configu" ---- diff --git a/ai-agents/apis/get-frontend-action.mdx b/ai-agents/apis/get-frontend-action.mdx deleted file mode 100644 index d0b65088f..000000000 --- a/ai-agents/apis/get-frontend-action.mdx +++ /dev/null @@ -1,4 +0,0 @@ ---- -openapi: get /ai-agents/agent-builder/frontend-actions/{id} -description: "Retrieves a specific frontend action by its unique ID. Use this endpoint to inspect a frontend action's configuration, parameters, and trigger function." ---- diff --git a/ai-agents/apis/get-mcp-server.mdx b/ai-agents/apis/get-mcp-server.mdx deleted file mode 100644 index f9d8ece73..000000000 --- a/ai-agents/apis/get-mcp-server.mdx +++ /dev/null @@ -1,4 +0,0 @@ ---- -openapi: get /ai-agents/agent-builder/mcp-servers/{slug} -description: "Retrieves a specific MCP server by its slug. Use this endpoint to inspect an MCP server's configuration and connected agents." ---- diff --git a/ai-agents/apis/get-text-detail.mdx b/ai-agents/apis/get-text-detail.mdx deleted file mode 100644 index f7029ebdd..000000000 --- a/ai-agents/apis/get-text-detail.mdx +++ /dev/null @@ -1,4 +0,0 @@ ---- -openapi: get /ai-agents/agent-builder/knowledge-base/text/{uniqueId} -description: "Retrieves a specific text-based knowledge base entry by its unique ID. Use this endpoint to inspect the content and status of a text entry." ---- diff --git a/ai-agents/apis/list-text-details.mdx b/ai-agents/apis/list-text-details.mdx deleted file mode 100644 index 5cd00ca86..000000000 --- a/ai-agents/apis/list-text-details.mdx +++ /dev/null @@ -1,4 +0,0 @@ ---- -openapi: get /ai-agents/agent-builder/knowledge-base/text -description: "Retrieves all text-based knowledge base entries for the application. Use this endpoint to view and manage text content in the knowledge base." ---- diff --git a/ai-agents/tools.mdx b/ai-agents/tools.mdx deleted file mode 100644 index 14584049a..000000000 --- a/ai-agents/tools.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: "AI Agent Tools" -sidebarTitle: "Tools" -description: "Explore the various tools you can use with your AI agent in CometChat." ---- - -## Overview - -Tools allow your AI agent to perform specific operations or integrate with external systems. -Once created, these tools can be invoked by **Actions** to execute tasks, fetch data, or interact with third-party APIs. - -You can use tools to: - -- Fetch data from external APIs. -- Trigger workflows in other systems. -- Perform backend logic before returning results to the chat. -- Extend your AI agent’s capabilities beyond basic responses. - ---- - -## Creating a Tool - -1. **Navigate to AI Agent → Tools** in the CometChat dashboard. -2. Click **Create Tool**. - -You will see the following fields: - -### **Display Name** -A human-friendly name shown in the UI. -_Example_: `Zendesk Ticket Creator` - -### **Execution Text** -A brief command or instruction for the AI to run when invoking this tool. -_Example_: `Create a Zendesk support ticket using the provided details.` - -### **Name** -A unique identifier for the tool. This name is critical: -- It must match exactly when used in an **Action’s Parameters** as the ``. -- Use lowercase with underscores for consistency. -_Example_: `zendesk_ticket_creator` - ---- - -## Linking Tools with Actions - -When you define an **Action** that uses this tool, its `Parameters` JSON schema must include a key matching the tool’s **Name**. - -Example: -```json -{ - "type": "object", - "properties": { - "zendesk_ticket_creator": { - "type": "string", - "description": "Details required to create the ticket" - } - } -} -``` - -This ensures that the Action passes the correct input to the intended tool. - ---- - -## Best Practices - -- **Name consistency is crucial** – mismatch between Tool Name and Action parameter key will break the link. -- **Keep execution text concise** – so the AI can easily understand the intended operation. -- **Use descriptive display names** – helpful for dashboard management. -- **Document tool requirements** – specify what input format or authentication is needed. -- **Test after creation** – trigger an Action that calls the tool to ensure it works end-to-end. diff --git a/ai-chatbots/custom-agents.mdx b/ai-chatbots/custom-agents.mdx deleted file mode 100644 index 0f67328e2..000000000 --- a/ai-chatbots/custom-agents.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: "Custom Agents" -description: "Custom Agents — CometChat documentation." ---- - -In CometChat, custom agents are unique users capable of autonomously sending and receiving messages. - -Users can interact with agents through private one-on-one conversations or within group chats. When an agent receives a message, whether from an individual chat or a group, CometChat relays that message to a `Callback URL` that you configure. Upon receiving the message, you can process it according to your business logic and send a response using CometChat's API. - -## Create a callback endpoint - -### Callback endpoint requirements - -1. Your callback endpoint must be accessible over HTTPS. This is essential to ensure the security and integrity of data transmission. -2. This URL should be publicly accessible from the internet. -3. Ensure that your endpoint supports the HTTP POST method. Event payloads will be delivered via HTTP POST requests in JSON format. -4. Configure your endpoint to respond immediately to the CometChat server with a 200 OK response. - -### Security - -It is recommended to set up a Basic Authentication that is usually used for server-to-server calls. This requires you to configure a username and password. Whenever your callback endpoint is triggered, the HTTP Header will contain: - -```html -Authorization: Basic -``` - -## Configuring a bot - -### Create a user - -CometChat requires each bot to be linked to a user account. This approach offers a significant benefit: It allows you to log in as the bot at any time and send personalized responses. - -Therefore, before setting up a bot, you must first create a new user. You can create a user from CometChat dashboard or make use of CometChat's [Create user](/rest-api/users/create) REST API to do so. - -### Create a bot - - - - - -After you've set up a user, you can proceed to create a new bot. - -1. Login to [CometChat](https://app.cometchat.com/login) dashboard and select your app. -2. Navigate to **AI Agents** > **Custom Agents** in the left-hand menu. -3. Add a new agent. -4. Configure the agent by saving the following details: - -* UID: The identifier (UID) of the user that was created in the previous step. -* URL: The callback URL of your agent. -* Group Setting: Select the criteria for relaying a group message to your agent. -* Security: It is recommended to enable authentication for your callback URL. - -5. Enable the agent. -6. Save the configuration. - -The actual development and behavior of the agent are completely in your hands. All you need to do is provide a Callback URL, and CometChat will then automatically relay all messages that meet the specified criteria to that URL. - -### Responding as an agent - -After your bot's callback endpoint has received and processed a message, and you're ready to send a response back, make use of CometChat's [Send Bot Message](/rest-api/messages/send-bot-message) REST API to do so. diff --git a/articles/calendar-scheduling.mdx b/articles/calendar-scheduling.mdx deleted file mode 100644 index 74a6dc6af..000000000 --- a/articles/calendar-scheduling.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: "Calendar Scheduling" -description: "Calendar Scheduling — CometChat documentation." ---- - -Enable users to book time on each other's calendars from CometChat. - -## How does it work? - -Calendar scheduling extension has the following features: - -1. Connect calendar -2. Share availability -3. Book a meeting -4. Receive an invite - -## Implementation - -### Connect calendar - -The extension serves a web page that allows users to connect their Google Calendar using their Gmail ID. The users need to give permission to read and write to their Primary Google calendar. - -The user can also use the same page to disconnect their calendar and probably connect another Google Calendar using a different Gmail ID. - -### Share availability - -Once the users connect their Google calendar using their Gmail ID, the extension is able to fetch the list of events that have been scheduled for the next 7 days in that calendar. The extension only gets the free-busy data in the form of Start time and the End time of the events. Other details about the events (like the title, description and participants) are not accessed by the extension. - -Users can choose to share their availability with any other user. The list of events is fetched by the extension and a Custom message is sent to the receiver on behalf of the sender with these details. - -### Book a meeting - -On receiving the list of events in the form of a message, it can be displayed on the receiver's end in a custom Calendar UI, with the busy slots representing all the events. - -The receiver can now select any free slot to book a meeting. The entry for this meeting gets automatically added to the sender's calendar that was connected in the earlier step. - -### Receive an invite - -On successfully scheduling the meeting in the sender's calendar, a Custom message is again sent by the extension on behalf of the sender. This message contains invitation links for various calendars like - Google Calendar, Yahoo Calendar, Outlook Calendar and details to create .ics file for Apple Calendar. - -The receiver can click on any of these links to add the event to the calendar of their choice. diff --git a/articles/docker.mdx b/articles/docker.mdx deleted file mode 100644 index 6d7a9717e..000000000 --- a/articles/docker.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: "Docker" -description: "Docker — CometChat documentation." ---- - -It is suggested to be familiar with the various kinds of roles for the on-premise deployment. - -## 1. Hardware required for Docker Swarm - -Below is the list of hardware required that you will need to provision. - -| Minimum CPU | Minimum RAM | Minimum Storage | Requires Public IP | VM | Open Public Ports | -| ----------- | ----------- | --------------- | ------------------ | --- | ----------------------------------------- | -| master | 8 core | 32GB | 250GB | Yes | TCP: 80,443 | -| storage1 | 8 core | 32GB | 250GB | No | | -| storage2 | 8 core | 32GB | 250GB | No | | -| calling | 8 core | 32GB | 50GB | Yes | TCP: 80,443, 10000-20000 UDP: 10000-20000 | -| websocket | 8 core | 32GB | 50GB | Yes | TCP: 80,443,7070,5222,5223 | -| node1 | 4 core | 8GB | 50GB | No | | -| node2 | 4 core | 8GB | 50GB | No | | -| extensions | 4 core | 8GB | 50GB | Yes | TCP: 80, 443 | - -## 2. Once the hardware and public IP's are ready - -Please inform us of the IP's so that we can complete the required DNS record changes and configurations. - -Ensure that the machines can connect to one another. - -## 3. Install docker, docker compose are installed on all machines - -Ensure that a recent docker (version `3.7`) with docker-compose is installed on all machines. - -## 4. Download the On-Prem shared by CometChat - -Which will be shared with you. - -## 5. Begin bootstrapping master - - - -This will be shared with you, and restricts the deployment by number. of attempts, the IP's , your customer metadata, billing and renewal with CometChat Pro. - - - -```bash -cd cometchatpro-onprem-dockerswarm-1.0.0 -._master_bootstrap.sh -``` - -Expected Logs - -```sh -Step 1: Please paste the CometChat Pro On-Premise Token shared with you -Password: -Login Succeeded -Step 2: Starting Docker Swarm for CometChat Pro On-Premise -Swarm initialized: current node (....) is now a manager. - -To add a worker to this swarm, run the following command: - - docker swarm join --token ... - -To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions. - -Step 3: Please run the above from node1 and node2 -``` - -You are now ready to bootstrap the other machines. Once they are all bootstrapped, we will come back to master to complete the bootstrap. - -## 6. Bootstrapping other machines - -Docker, docker-compose and the CometChat Folder must be available. - -```bash -# see step2 of bootstrap master -docker swarm join... - -cd cometchatpro-onprem-dockerswarm-1.0.0 - -#on calling -._calling_bootstrap.sh - -#on websocket -._calling_bootstrap.sh - -#on node1, node2 -._node_bootstrap.sh - -#on extensions -._extensions_bootstrap.sh -``` diff --git a/articles/rate-limits.mdx b/articles/rate-limits.mdx deleted file mode 100644 index 1db40e2b1..000000000 --- a/articles/rate-limits.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: "Rate Limits" -description: "Rate Limits — CometChat documentation." ---- - -### CometChat REST API Rate Limits - - - -The rate limits below are for general applications. Rate limits can be adjusted on a per need basis, depending on your use-case and plan. - - - -| **Rate Limiting Groups** | **100** | **1K** | **2500** | **5K** | **10k** | -| ------------------------ | ------- | ------- | -------- | ------- | ------- | -| Standard Operations | 20k req | 20k req | 20k req | 20k req | 20k req | -| Core Operations | 10k req | 10k req | 10k req | 10k req | 10k req | - -## What happens when rate limit is reached ? - -The request isn't processed and a response is sent containing a 429 response code. Along with the response code there will be couple of headers sent which specifies the time in seconds that you must wait before you can try request again. - -`Retry-After: 15` - -`X-Rate-Limit-Reset: 1625143246` - -## Is there any endpoint that returns rate limit of all resources ? - -No, we don't provide a rate-limit endpoint. - -However, we do provide the following response headers that you can use to confirm the app's current rate limit and monitor the number of requests remaining in the current minute: - -`X-Rate-Limit: 700` - -`X-Rate-Limit-Remaining: 699` diff --git a/calls/ionic/overview.mdx b/calls/ionic/overview.mdx deleted file mode 100644 index 48f34258e..000000000 --- a/calls/ionic/overview.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "Calls SDK" -sidebarTitle: "Overview" -description: "Overview of Calls SDK in CometChat." ---- - - -Documentation coming soon for Ionic Calls SDK. - -## Sample App - - - - - Explore the Ionic Calls SDK sample app on GitHub - - - - View the latest releases and changes - - - diff --git a/calls/webhooks.mdx b/calls/webhooks.mdx index 673a21d3d..903d9238d 100644 --- a/calls/webhooks.mdx +++ b/calls/webhooks.mdx @@ -7,7 +7,7 @@ description: "Use CometChat Calls webhooks to receive voice and video call event CometChat sends real-time webhook notifications throughout the lifecycle of your ringing calls and call sessions. Use these to track activity, trigger backend workflows, build analytics dashboards, or keep your systems in sync. -To configure webhooks for your app, see the [Webhook Management](/fundamentals/webhooks-management) guide. For general webhook concepts, see the [Webhooks Overview](/fundamentals/webhooks-overview). +To configure webhooks for your app, and for general webhook concepts, see the [Webhooks](/fundamentals/webhooks) guide. ## How It Works diff --git a/campaigns/webhooks.mdx b/campaigns/webhooks.mdx deleted file mode 100644 index 416a12d03..000000000 --- a/campaigns/webhooks.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "Webhooks" -sidebarTitle: "Webhooks" -description: "Track campaign delivery and engagement in real-time with webhook events." ---- - -Campaign webhook events are triggered during the lifecycle of campaigns, notifications, feed items, and push notifications. These events allow you to track delivery and engagement in real-time. - -Webhook configuration and event payloads are documented in the main Webhooks section. - - - View webhook setup, trigger list, and payload examples - diff --git a/docs.json b/docs.json index 75e48e794..ee2b76d29 100644 --- a/docs.json +++ b/docs.json @@ -4883,7 +4883,9 @@ "pages": [ "sdk/unreal/send-message", "sdk/unreal/receive-messages", + "sdk/unreal/conversations", "sdk/unreal/real-time-events", + "sdk/unreal/transient-messages", "sdk/unreal/typing-indicators", "sdk/unreal/delivery-read-receipts", "sdk/unreal/connection-status" @@ -4896,9 +4898,22 @@ "sdk/unreal/groups" ] }, + { + "group": "Moderation", + "pages": [ + "sdk/unreal/moderation" + ] + }, + { + "group": "UI", + "pages": [ + "sdk/unreal/ui-components" + ] + }, { "group": "Reference", "pages": [ + "sdk/unreal/advanced-configuration", "sdk/unreal/reference" ] } @@ -10668,6 +10683,98 @@ { "source": "/notifications/flutter-push-notifications-ios", "destination": "/notifications/flutter-push-notifications" + }, + { + "source": "/ai-agents/apis/get-frontend-action", + "destination": "/rest-api/ai-agents-apis/frontend-actions/get-frontend-action" + }, + { + "source": "/ai-agents/apis/list-text-details", + "destination": "/rest-api/ai-agents-apis/knowledge-base/list-text-entries" + }, + { + "source": "/ai-agents/apis/get-text-detail", + "destination": "/rest-api/ai-agents-apis/knowledge-base/get-text-entry" + }, + { + "source": "/ai-agents/apis/get-api-tool", + "destination": "/rest-api/ai-agents-apis/custom-api-tools/get-api-tool" + }, + { + "source": "/ai-agents/apis/get-mcp-server", + "destination": "/rest-api/ai-agents-apis/mcp-servers/get-mcp-server" + }, + { + "source": "/ai-agents/apis/get-available-models", + "destination": "/rest-api/ai-agents-apis/agents/list-available-models" + }, + { + "source": "/sdk/unreal/SAMPLE_APP", + "destination": "/sdk/unreal/overview" + }, + { + "source": "/ui-kit/kotlin/overview", + "destination": "/ui-kit/android/overview" + }, + { + "source": "/ui-kit/kotlin/key-concepts", + "destination": "/ui-kit/android/overview" + }, + { + "source": "/ui-kit/kotlin/ui-components", + "destination": "/ui-kit/android/overview" + }, + { + "source": "/ui-kit/kotlin/customize-ui-kit", + "destination": "/ui-kit/android/overview" + }, + { + "source": "/ui-kit/kotlin/2.0/overview", + "destination": "/ui-kit/android/overview" + }, + { + "source": "/ui-kit/kotlin/2.0/key-concepts", + "destination": "/ui-kit/android/overview" + }, + { + "source": "/ui-kit/kotlin/2.0/ui-components", + "destination": "/ui-kit/android/overview" + }, + { + "source": "/ui-kit/kotlin/2.0/customize-ui-kit", + "destination": "/ui-kit/android/overview" + }, + { + "source": "/ui-kit/kotlin/2.0/message-structure-and-hierarchy", + "destination": "/ui-kit/android/overview" + }, + { + "source": "/ui-kit/angular/2.0/javascript-2-0-overview", + "destination": "/ui-kit/angular/overview" + }, + { + "source": "/calls/ionic/overview", + "destination": "/calls/javascript/ionic-integration" + }, + { + "source": "/articles/calendar-scheduling", + "destination": "/fundamentals/extensions-overview" + }, + { + "source": "/articles/rate-limits", + "destination": "/sdk/javascript/rate-limits" + }, + { + "source": "/campaigns/webhooks", + "destination": "/rest-api/management-apis/webhooks/overview" + }, + { + "source": "/ai-chatbots/custom-agents", + "destination": "/ai-chatbots/custom-bots" + }, + { + "source": "/sdk/flutter/v5/v5-docs-changelog", + "destination": "/sdk/flutter/changelog" } ], "seo": { diff --git a/fundamentals/webhooks-overview.mdx b/fundamentals/webhooks-overview.mdx deleted file mode 100644 index 1e1a2bfc5..000000000 --- a/fundamentals/webhooks-overview.mdx +++ /dev/null @@ -1,176 +0,0 @@ ---- -title: "Webhooks Overview" -description: "Set up a secure HTTPS endpoint that receives real-time CometChat events for messages, users, groups and calls, and handle retries and timeouts safely." -sidebarTitle: "Overview" ---- - -CometChat Webhooks enable real-time, event-driven communication with your server by sending HTTP POST requests for specific events such as messages, user actions, group updates, calls, and moderation results. - -You can use webhooks to build custom workflows such as sending SMS or email notifications, logging activity, syncing with external systems, or triggering automation. - -*** - -## Setting Up Your Webhook Endpoint - -To successfully receive and process events from CometChat, your webhook endpoint must meet the following criteria: - -1. **Use HTTPS** – All webhook URLs must be secured with SSL. -2. **Be publicly accessible** – Your server should be reachable from the internet. -3. **Support POST method** – Events will be delivered as `HTTP POST` requests with `application/json` content. -4. **Return a 200 OK** – Your endpoint must acknowledge receipt by responding with `HTTP 200`. - -*** - -## Securing Your Webhook - -### Basic Authentication (Recommended) - -To ensure only authorized systems can access your endpoint, use Basic Authentication: - -```html -Authorization: Basic -``` - -You can configure this with a username and password known only to your system. - -*** - -## Webhook Best Practices - -To maximize reliability and avoid common issues, follow these recommendations: - -### 1. Handle Retries Gracefully - -* Use the `retryOnFailure` flag when setting up webhooks. - -* If enabled, CometChat retries failed deliveries: - - * First retry: after 10 seconds. - * Second retry: after 30 seconds. - -* Use unique event IDs from payloads to **deduplicate** retries. - -### 2. Respond Quickly - -* Respond within **2 seconds** to prevent timeouts. -* For long processing tasks, enqueue events to systems like **Kafka, RabbitMQ, or AWS SQS**, and process them asynchronously. - -### 3. Log and Monitor - -* Maintain detailed logs of all incoming webhook requests and your server responses. -* Track failures, latency, and retry attempts. - -### 4. Implement Robust Error Handling - -* Return appropriate HTTP status codes: - - * `200 OK` for success. - * `4xx` for client-side errors (e.g., bad request). - * `5xx` for server-side issues. - -### 5. Thoroughly Test Before Production - -* Simulate various conditions: successful delivery, retries, and failures. -* Ensure your implementation handles all cases gracefully. - -*** - -## Webhook Event Triggers - -CometChat supports webhook triggers for different categories of events. Click each event name to see its payload and details. - -*** - -### Message Events - -| Event | Description | -| ----------------------------------------------------------------------------------------- | ---------------------------------------------------- | -| [message\_sent](/fundamentals/webhooks#message_sent) | Triggered after a message is sent. | -| [message\_edited](/fundamentals/webhooks#message_edited) | Triggered after a message is edited. | -| [message\_deleted](/fundamentals/webhooks#message_deleted) | Triggered after a message is deleted. | -| [message\_delivery\_receipt](/fundamentals/webhooks#message_delivery_receipt) | Triggered when a message is delivered to the client. | -| [message\_read\_receipt](/fundamentals/webhooks#message_read_receipt) | Triggered when a message is marked as read. | -| [message\_reaction\_added](/fundamentals/webhooks#message_reaction_added) | Triggered when a user reacts to a message. | -| [message\_reaction\_removed](/fundamentals/webhooks#message_reaction_removed) | Triggered when a reaction is removed. | -| [user\_mentioned](/fundamentals/webhooks#user_mentioned) | Triggered when a user is mentioned in a message. | - -*** - -### User Events - -| Event | Description | -| ------------------------------------------------------------------------------------------------------ | -------------------------------------------- | -| [user\_blocked](/fundamentals/webhooks#user_blocked) | Triggered when a user blocks another user. | -| [user\_unblocked](/fundamentals/webhooks#user_unblocked) | Triggered when a user unblocks another user. | -| [user\_connection\_status\_changed](/fundamentals/webhooks#user_connection_status_changed) | Triggered when a user connects/disconnects. | - -*** - -### Group Events - -| Event | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------- | -| [group\_created](/fundamentals/webhooks#group_created) | Triggered after a group is created. | -| [group\_updated](/fundamentals/webhooks#group_updated) | Triggered after a group is updated. | -| [group\_deleted](/fundamentals/webhooks#group_deleted) | Triggered after a group is deleted. | -| [group\_member\_added](/fundamentals/webhooks#group_member_added) | Triggered when a member is added. | -| [group\_member\_removed](/fundamentals/webhooks#group_member_removed) | Triggered when a member is removed. | -| [group\_member\_banned](/fundamentals/webhooks#group_member_banned) | Triggered when a member is banned. | -| [group\_member\_unbanned](/fundamentals/webhooks#group_member_unbanned) | Triggered when a member is unbanned. | -| [group\_member\_joined](/fundamentals/webhooks#group_member_joined) | Triggered when a user joins a group. | -| [group\_member\_left](/fundamentals/webhooks#group_member_left) | Triggered when a user leaves a group. | -| [group\_member\_kicked](/fundamentals/webhooks#group_member_kicked) | Triggered when a member is kicked. | -| [group\_member\_scope\_changed](/fundamentals/webhooks#group_member_scope_changed) | Triggered when a member's scope changes. | -| [group\_owner\_transferred](/fundamentals/webhooks#group_owner_transferred) | Triggered when group ownership is transferred. | - -*** - -### Call and Meeting Events - -| Event | Description | -| --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -| [call\_initiated](/fundamentals/webhooks#call_initiated) | Triggered when a call is initiated. | -| [call\_started](/fundamentals/webhooks#call_started) | Triggered when a call starts. | -| [call\_ended](/fundamentals/webhooks#call_ended) | Triggered when a call ends. | -| [call\_participant\_joined](/fundamentals/webhooks#call_participant_joined) | Triggered when a participant joins a call. | -| [call\_participant\_left](/fundamentals/webhooks#call_participant_left) | Triggered when a participant leaves a call. | -| [call\_busy](/fundamentals/webhooks#call_busy) | This hook is triggered when a 1-on-1 call cannot be connected because the recipient is already on another call (i.e., their line is busy). | -| [call\_cancelled](/fundamentals/webhooks#call_cancelled) | The hook triggers when the call is cancelled. | -| [call\_rejected](/fundamentals/webhooks#call_rejected) | This hook is triggered when a 1-on-1 call is explicitly rejected by the recipient. | -| [call\_unanswered](/fundamentals/webhooks#call_unanswered) | This hook is triggered when a call goes unanswered. | -| [meeting\_started](/fundamentals/webhooks#meeting_started) | Triggered when a meeting starts. | -| [meeting\_ended](/fundamentals/webhooks#meeting_ended) | Triggered when a meeting ends. | -| [meeting\_participant\_joined](/fundamentals/webhooks#meeting_participant_joined) | Triggered when a participant joins a meeting. | -| [meeting\_participant\_left](/fundamentals/webhooks#meeting_participant_left) | Triggered when a participant leaves a meeting. | -| [recording\_generated](/fundamentals/webhooks#recording_generated) | Triggered when a recording is generated. | - -*** - -### Moderation Events - -| Event | Description | -| --------------------------------------------------------------------------------------------- | ------------------------------------------------------ | -| [moderation\_engine\_approved](/fundamentals/webhooks#moderation_engine_approved) | Triggered when a message is auto-approved. | -| [moderation\_engine\_blocked](/fundamentals/webhooks#moderation_engine_blocked) | Triggered when a message is auto-blocked. | -| [moderation\_manual\_approved](/fundamentals/webhooks#moderation_manual_approved) | Triggered when a blocked message is manually approved. | - -*** - -### Campaign Events - -| Event | Description | -| ----------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| [after\_campaign\_completed](/fundamentals/webhooks#after_campaign_completed) | Triggered when a campaign finishes sending to all targets. | -| [after\_campaign\_failed](/fundamentals/webhooks#after_campaign_failed) | Triggered when a campaign fails to deliver to its targets. | -| [after\_notification\_created](/fundamentals/webhooks#after_notification_created) | Triggered when a notification is created and begins dispatching. | -| [after\_feed\_item\_sent](/fundamentals/webhooks#after_feed_item_sent) | Triggered when an in-app feed item is sent to a user. | -| [after\_feed\_item\_delivered](/fundamentals/webhooks#after_feed_item_delivered) | Triggered when a feed item is delivered to the user's device. | -| [after\_feed\_item\_read](/fundamentals/webhooks#after_feed_item_read) | Triggered when a user reads a feed item. | -| [after\_feed\_item\_interacted](/fundamentals/webhooks#after_feed_item_interacted) | Triggered when a user interacts with a feed item. | -| [after\_push\_notification\_sent](/fundamentals/webhooks#after_push_notification_sent) | Triggered when a push notification is sent. | -| [after\_push\_notification\_delivered](/fundamentals/webhooks#after_push_notification_delivered) | Triggered when a push notification is delivered to the user's device. | -| [after\_push\_notification\_clicked](/fundamentals/webhooks#after_push_notification_clicked) | Triggered when a user clicks on a push notification. | - -*** - -By following this guide, you can seamlessly integrate CometChat webhooks into your system and build event-driven experiences at scale. diff --git a/sdk/android/2.0/overview.mdx b/sdk/android/2.0/overview.mdx index 955963ed1..a6537de87 100644 --- a/sdk/android/2.0/overview.mdx +++ b/sdk/android/2.0/overview.mdx @@ -250,4 +250,4 @@ UID can be alphanumeric with underscore and hyphen. Spaces, punctuation and othe ### Integrate our UI Kits * Please refer [Overview](/ui-kit/android/overview) section to integrate Android Java UI Kit inside your app. -* Please refer [Android Kotlin UI Kit](/ui-kit/kotlin/overview) section to integrate Android Kotlin UI Kit inside your app. +* Please refer [Android UI Kit](/ui-kit/android/overview) section to integrate Android Kotlin UI Kit inside your app. diff --git a/sdk/android/3.0/overview.mdx b/sdk/android/3.0/overview.mdx index e15458693..5ed69a774 100644 --- a/sdk/android/3.0/overview.mdx +++ b/sdk/android/3.0/overview.mdx @@ -284,4 +284,4 @@ UID can be alphanumeric with underscore and hyphen. Spaces, punctuation and othe ### Integrate our UI Kits * Please refer [Android Java UI Kit](/ui-kit/android/v3/overview) section to integrate Android Java UI Kit inside your app. -* Please refer [Android Kotlin UI Kit](/ui-kit/kotlin/overview) section to integrate Android Kotlin UI Kit inside your app. +* Please refer [Android UI Kit](/ui-kit/android/overview) section to integrate Android Kotlin UI Kit inside your app. diff --git a/sdk/android/v5/llms-android-v5.mdx b/sdk/android/v5/llms-android-v5.mdx index 239fd0137..e5762a8c0 100644 --- a/sdk/android/v5/llms-android-v5.mdx +++ b/sdk/android/v5/llms-android-v5.mdx @@ -142,7 +142,7 @@ outside the SDK tree: - **Push (Android):** [Push overview](/notifications/push-overview) · [**Android push notifications**](/notifications/android-push-notifications) · [Badge count](/notifications/badge-count) · [Limits](/notifications/constraints-and-limits) · [Notification extensions](/fundamentals/notification-extensions) - **Campaigns:** [Campaigns](/campaigns/campaigns) · [Templates](/campaigns/templates) · [Channels](/campaigns/channels) - **Auth & permissions:** [User auth](/fundamentals/user-auth) · [Roles & permissions](/fundamentals/user-roles-and-permissions) · [Mentions](/fundamentals/mentions) -- **Server-side hooks:** [Webhooks overview](/fundamentals/webhooks-overview) · [Call webhooks](/calls/webhooks) · [Ringing webhooks](/calls/webhooks-ringing) +- **Server-side hooks:** [Webhooks overview](/fundamentals/webhooks) · [Call webhooks](/calls/webhooks) · [Ringing webhooks](/calls/webhooks-ringing) ## Migration & misc - [Upgrading from v4](/sdk/android/v5/upgrading-from-v4) diff --git a/sdk/flutter/v5/v5-docs-changelog.md b/sdk/flutter/v5/v5-docs-changelog.md deleted file mode 100644 index cff1dab5c..000000000 --- a/sdk/flutter/v5/v5-docs-changelog.md +++ /dev/null @@ -1,148 +0,0 @@ -# Flutter SDK v5 Documentation Changelog - -This file tracks all changes made to the v5 documentation. - ---- - -## Changes Log - -### Date: March 26, 2026 - -#### SDK Changes - Deprecated Methods Removed -- [x] Removed `markAsUnread()` method from `cometchat.dart` (use `markMessageAsUnread()`) -- [x] Removed `receaverUid` parameter from `startTyping()` and `endTyping()` - `receiverUid` is now required -- [x] Removed `fetchPushPreferences()`, `updatePushPreferences()`, `resetPushPreferences()` from `cometchat_notifications.dart` -- [x] Removed `PushPreferences` class from `push_preferences.dart` (use `NotificationPreferences`) - -#### Documentation Updates - Deprecation Warnings Removed -- [x] Updated `typing-indicators.mdx` - removed deprecation warnings for `receaverUid` -- [x] Updated `delivery-read-receipts.mdx` - removed deprecation warning for `markAsUnread()` -- [x] Updated `upgrading-from-v4-guide.mdx`: - - Removed `lastReadMessageId` type change section (was already int) - - Changed "Deprecations" section to "Method Migrations" (methods are now removed, not deprecated) - - Updated migration checklist - -#### Initial Setup -- [x] Copied all v4 docs to `docs/sdk/flutter/v5/` folder (64 files) -- [x] Created this changelog file - ---- - -## Completed Updates - -### 1. delivery-read-receipts.mdx ✅ -- [x] Updated `markAsUnread()` to `markMessageAsUnread()` with deprecation notice -- [x] Added `markConversationAsDelivered()` method documentation -- [x] Added `markConversationAsRead()` method documentation -- [x] Updated Enhanced Messaging Status feature list - -### 2. send-message.mdx ✅ -- [x] Added "Send Multiple Media Files" section with code examples -- [x] Added "File Size and Count Validation" section with error handling - -### 3. retrieve-conversations.mdx ✅ -- [x] Added `userTags` filter documentation -- [x] Added `groupTags` filter documentation -- [x] Added `hideAgentic` filter documentation -- [x] Added `onlyAgentic` filter documentation -- [x] Updated `lastReadMessageId` description to note int type - -### 4. retrieve-users.mdx ✅ -- [x] Added `searchIn` parameter documentation -- [x] Added `sortBy` parameter documentation -- [x] Added `sortByOrder` parameter documentation -- [x] Added combined example for all new parameters - -### 5. create-group.mdx ✅ -- [x] Added `createGroupWithMembers()` method documentation -- [x] Added `isBannedFromGroup` property to Group Class table - -### 6. retrieve-group-members.mdx ✅ -- [x] Added status filter (`CometChatUserStatus.online/offline`) documentation - -### 7. additional-message-filtering.mdx ✅ -- [x] Added "Direct Page Navigation" section with `setPage()` method -- [x] Updated default limit note (50 → 30) -- [x] Added `attachmentTypes` filter documentation -- [x] Added `hideQuotedMessages` filter documentation - -### 8. typing-indicators.mdx ✅ -- [x] Updated code examples to use `receiverUid` instead of `receaverUid` -- [x] Added deprecation notices for `receaverUid` parameter - -### 9. upgrading-from-v4-guide.mdx ✅ (NEW) -- [x] Created comprehensive migration guide -- [x] Documented breaking changes (lastReadMessageId type, default limit) -- [x] Documented all deprecations -- [x] Documented all new features -- [x] Added migration checklist - ---- - -## Summary of Changes - -| File | Changes Made | -|------|--------------| -| delivery-read-receipts.mdx | 4 updates, removed deprecation warning | -| send-message.mdx | 2 new sections | -| retrieve-conversations.mdx | 5 updates | -| retrieve-users.mdx | 4 new parameters | -| create-group.mdx | 2 additions | -| retrieve-group-members.mdx | 1 new filter | -| additional-message-filtering.mdx | 4 updates | -| typing-indicators.mdx | Removed deprecation notices (methods now removed) | -| upgrading-from-v4-guide.mdx | Updated for removed methods | - ---- - -## SDK Changes (v5) - -### Removed Methods -- `markAsUnread()` - use `markMessageAsUnread()` instead -- `receaverUid` parameter - use `receiverUid` (now required) -- `fetchPushPreferences()` - use `fetchPreferences()` instead -- `updatePushPreferences()` - use `updatePreferences()` instead -- `resetPushPreferences()` - use `resetPreferences()` instead -- `PushPreferences` class - use `NotificationPreferences` instead - ---- - -## Features Documented - -### New Methods -- `markMessageAsUnread()` - replaces deprecated `markAsUnread()` -- `markConversationAsDelivered()` - mark entire conversation as delivered -- `markConversationAsRead()` - mark entire conversation as read -- `createGroupWithMembers()` - create group with members in one step - -### New Filters/Parameters -- `userTags` - filter conversations by user tags -- `groupTags` - filter conversations by group tags -- `hideAgentic` - hide AI-driven conversations -- `onlyAgentic` - show only AI-driven conversations -- `searchIn` - specify user fields to search -- `sortBy` - sort users by field -- `sortByOrder` - sort order (asc/desc) -- `status` - filter group members by online/offline -- `page` - direct page navigation -- `attachmentTypes` - filter by attachment types -- `hideQuotedMessages` - exclude quoted messages - -### New Capabilities -- Multiple media files in single message -- File size/count validation -- `isBannedFromGroup` property in Group class - -### Breaking Changes Documented -- Default limit: 50 → 30 -- Removed deprecated methods (see SDK Changes section above) - ---- - -## Navigation Configuration - -### docs.json Updated ✅ -- Added v5 version entry to Flutter SDK dropdown -- v5 is now the first/default version shown -- All v5 doc paths point to `sdk/flutter/v5/` folder -- Includes `upgrading-from-v4-guide` in Resources section diff --git a/sdk/unreal/SAMPLE_APP.md b/sdk/unreal/SAMPLE_APP.md deleted file mode 100644 index 7a92dbe44..000000000 --- a/sdk/unreal/SAMPLE_APP.md +++ /dev/null @@ -1,230 +0,0 @@ -# CometChat Unreal Engine — Sample App (Group Chat Box) - -The CometChat plugin ships with a ready-to-use **Group Chat Box** widget (`UCometChatGroupChatBox`) that handles the entire chat flow out of the box: configure, login, join group, load history, send messages, and receive messages in real time. - -It's designed as a starting point — use it as-is for quick integration, or as a reference for building your own custom chat UI. - -## What It Does - -``` -Drop widget into viewport → Auto-configures SDK → Logs in user → Joins group → Loads message history → Ready — send & receive -``` - ---- - -## Quick Start - -### Blueprint - -1. Create a new **Widget Blueprint** (or open an existing HUD widget) -2. In the Palette, search for **CometChat Group Chat Box** -3. Drag it onto your canvas -4. In the **Details** panel, fill in the config properties: - -| Property | Value | -| -------- | ----- | -| **App Id** | Your CometChat App ID | -| **Region** | `us` or `eu` | -| **Auth Key** | Your CometChat Auth Key | -| **User Uid** | The UID of the player to log in as | -| **Group Guid** | The GUID of the group to join | - -5. Play — the widget handles everything automatically - -### C++ - -```cpp -#include "UI/CometChatGroupChatBox.h" - -void AMyHUD::BeginPlay() -{ - Super::BeginPlay(); - - UCometChatGroupChatBox* ChatBox = CreateWidget( - GetOwningPlayerController(), - UCometChatGroupChatBox::StaticClass() - ); - - ChatBox->AppId = TEXT("YOUR_APP_ID"); - ChatBox->Region = TEXT("us"); - ChatBox->AuthKey = TEXT("YOUR_AUTH_KEY"); - ChatBox->UserUid = TEXT("cometchat-uid-1"); - ChatBox->GroupGuid = TEXT("your-group-guid"); - - ChatBox->AddToViewport(10); -} -``` - ---- - -## How It Works - -When the widget is constructed, it runs an automatic flow: - -``` -NativeConstruct - → Configure SDK - → Bind OnMessageReceived - → Login with UserUid + AuthKey - → Success: Join group with GroupGuid - → Failure: Show error overlay - → Join group - → Success: Load message history - → Already a member: Load message history - → Failure: Show error overlay - → Load message history - → Success: Display messages + hide overlay - → Ready — user can type and send -``` - -The widget shows a loading overlay during each step ("Configuring...", "Logging in...", "Joining group...", "Loading messages...") and transitions to the chat view once ready. - ---- - -## Widget Structure - -The widget builds its entire UI programmatically in C++ — no Blueprint designer layout needed. - -``` -UCometChatGroupChatBox -├── SizeBox (PanelWidth x PanelHeight) -│ └── Overlay -│ ├── Border (rounded panel background) -│ │ └── VerticalBox -│ │ ├── ScrollBox (message list, fills available space) -│ │ │ └── Message rows (added dynamically) -│ │ └── HorizontalBox (composer row) -│ │ ├── Border (rounded input background) -│ │ │ └── EditableTextBox (message input) -│ │ ├── Button (send button, circular) -│ │ └── Button (options button, optional) -│ └── Border (loading overlay, hidden when ready) -│ └── TextBlock (status text) -``` - -Each message row contains: -- **Avatar** — circular with initial letter, loads actual image from URL asynchronously -- **Online indicator** — green dot on the avatar -- **Username** — colored differently for self vs others -- **Message text** — white, auto-wrapping -- **Timestamp** — gray, right-aligned (HH:MM format) - ---- - -## Customization - -Every visual aspect is exposed as a `UPROPERTY` — editable in the Blueprint Details panel or settable in C++. - -### Panel - -| Property | Type | Default | Description | -| -------- | ---- | ------- | ----------- | -| `PanelWidth` | `float` | `520` | Widget width in pixels | -| `PanelHeight` | `float` | `300` | Widget height in pixels | -| `PanelBackgroundColor` | `FLinearColor` | `(0, 0, 0, 0.35)` | Panel background with alpha | -| `PanelCornerRadius` | `float` | `12` | Rounded corner radius | -| `PanelPadding` | `float` | `12` | Inner padding | -| `MessageLimit` | `int32` | `30` | Messages to load from history | - -### Messages - -| Property | Type | Default | Description | -| -------- | ---- | ------- | ----------- | -| `SenderNameColor` | `FLinearColor` | Yellow | Your username color | -| `ReceiverNameColor` | `FLinearColor` | Blue | Other users' name color | -| `MessageTextColor` | `FLinearColor` | White (0.9 alpha) | Message body color | -| `UsernameFontSize` | `float` | `15` | Username text size | -| `MessageFontSize` | `float` | `15` | Message body text size | -| `MessageSpacing` | `float` | `6` | Vertical gap between messages | -| `bEnableTextShadow` | `bool` | `true` | Drop shadow on text | - -### Avatars - -| Property | Type | Default | Description | -| -------- | ---- | ------- | ----------- | -| `bShowAvatars` | `bool` | `true` | Show circular avatars | -| `AvatarSize` | `float` | `36` | Avatar diameter in pixels | -| `AvatarPlaceholderColor` | `FLinearColor` | Gray | Background when no image | -| `bShowOnlineIndicator` | `bool` | `true` | Green dot on avatar | -| `OnlineIndicatorColor` | `FLinearColor` | Green | Indicator dot color | - -### Composer - -| Property | Type | Default | Description | -| -------- | ---- | ------- | ----------- | -| `ComposerBackgroundColor` | `FLinearColor` | Dark gray | Input field background | -| `ComposerCornerRadius` | `float` | `20` | Input field corner radius | -| `ComposerPlaceholderText` | `FString` | `"Type a message..."` | Placeholder text | - -### Send Button - -| Property | Type | Default | Description | -| -------- | ---- | ------- | ----------- | -| `SendButtonLabel` | `FString` | `">"` | Button text | -| `SendButtonColor` | `FLinearColor` | Blue | Button background | -| `SendButtonWidth` | `float` | `42` | Button size (square) | -| `SendButtonCornerRadius` | `float` | `20` | Makes it circular | - -### Options Button - -| Property | Type | Default | Description | -| -------- | ---- | ------- | ----------- | -| `bShowOptionsButton` | `bool` | `true` | Show the "..." button | -| `OptionsButtonLabel` | `FString` | `"..."` | Button text | - -### Timestamps - -| Property | Type | Default | Description | -| -------- | ---- | ------- | ----------- | -| `bShowTimestamp` | `bool` | `true` | Show HH:MM timestamps | -| `TimestampColor` | `FLinearColor` | Gray | Timestamp text color | -| `TimestampFontSize` | `float` | `11` | Timestamp text size | - ---- - -## Events - -The widget exposes one event dispatcher: - -| Event | Description | -| ----- | ----------- | -| `OnOptionsClicked` | Fires when the user clicks the options ("...") button. Bind this to show a custom menu (e.g., leave group, mute, settings). | - -### Blueprint - -In the Details panel, find **On Options Clicked** under Events and click the **+** to bind it. - -### C++ - -```cpp -ChatBox->OnOptionsClicked.AddDynamic(this, &AMyHUD::HandleChatOptions); -``` - ---- - -## Real-Time Messages - -The widget automatically binds to `OnMessageReceived` on the `UCometChatSubsystem`. When a new group message arrives: - -1. It checks if the message belongs to the configured `GroupGuid` -2. It filters out messages sent by the current user (to avoid duplicates — sent messages are already added on send) -3. It creates a new message row and scrolls to the bottom - -No additional wiring needed. - ---- - -## Loading States - -The widget shows an overlay with status text during each phase: - -| State | Overlay Text | -| ----- | ------------ | -| Configuring | "Configuring..." | -| Logging In | "Logging in..." | -| Joining Group | "Joining group..." | -| Loading History | "Loading messages..." | -| Ready | Overlay hidden | -| Error | Error message displayed | - -The overlay background color and text style are customizable via the `Overlay` properties. diff --git a/ui-kit/android/llms-android-v6.mdx b/ui-kit/android/llms-android-v6.mdx index 6d5995955..8ae83fcfe 100644 --- a/ui-kit/android/llms-android-v6.mdx +++ b/ui-kit/android/llms-android-v6.mdx @@ -184,7 +184,7 @@ The UI Kit renders nothing for push — it is a dashboard + FCM + service integr ## Campaigns, auth & webhooks - **Campaigns / announcements:** [Campaigns](/campaigns/campaigns) · [Templates](/campaigns/templates) · [Channels](/campaigns/channels) - **Auth & permissions:** [User auth](/fundamentals/user-auth) · [Roles & permissions](/fundamentals/user-roles-and-permissions) · [Mentions](/fundamentals/mentions) -- **Server-side hooks:** [Webhooks overview](/fundamentals/webhooks-overview) · [Call webhooks](/calls/webhooks) · [Ringing webhooks](/calls/webhooks-ringing) +- **Server-side hooks:** [Webhooks overview](/fundamentals/webhooks) · [Call webhooks](/calls/webhooks) · [Ringing webhooks](/calls/webhooks-ringing) ## Migration & misc - [Upgrading from v5 to v6](/ui-kit/android/upgrading-from-v5) diff --git a/ui-kit/android/v3/overview.mdx b/ui-kit/android/v3/overview.mdx index 2cfa2df55..ad5b348f4 100644 --- a/ui-kit/android/v3/overview.mdx +++ b/ui-kit/android/v3/overview.mdx @@ -10,7 +10,7 @@ description: "Overview of Overview in CometChat." Reference for Kotlin UI Kit. -Check out our Kotlin UI Kit [here](/ui-kit/kotlin/customize-ui-kit). +Check out our [Android UI Kit](/ui-kit/android/overview). diff --git a/ui-kit/angular/2.0/javascript-2-0-overview.mdx b/ui-kit/angular/2.0/javascript-2-0-overview.mdx deleted file mode 100644 index edf236ad5..000000000 --- a/ui-kit/angular/2.0/javascript-2-0-overview.mdx +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: "JavaScript SDK" -url: "/sdk/javascript/2.0/overview" -description: "Navigate to JavaScript SDK documentation." ---- \ No newline at end of file diff --git a/ui-kit/kotlin/2.0/customize-ui-kit.mdx b/ui-kit/kotlin/2.0/customize-ui-kit.mdx deleted file mode 100644 index f07b2d4b5..000000000 --- a/ui-kit/kotlin/2.0/customize-ui-kit.mdx +++ /dev/null @@ -1,144 +0,0 @@ ---- -title: "Customize UI Kit" -description: "Customize UI Kit — CometChat documentation." ---- - -Version: v2 - - - - - -This guide helps you to customize, modify, and enable/disable features present in UIKit. - - - -CometChat SDK & UI Kit both need to be configured before starting the customization in UI Kit. - - - -*** - -To Modify and customize UI Kit, you need to refer to the `UIKitSettings` class present in the UI Kit Library. You will be easily able to modify the color, enable/disable some of the features which you won't require in your app. - - -Important - -* UI Kit Settings must be called before launching any UI Screen or UI Unified. By default, all settings will be enabled. - -* For advanced level customization, you can modify the source code of the library as per your requirement. - - - -### **Color Settings** - -| Description | Code Snippet | Settings | -| --------------------- | ------------------------------- | --------------------------------------------------- | -| Modify primary colour | `UIKitSettings.color = #F3F3F3` | Requires Hex value of color as String

Ex: "#F3F3F3" | - -*** - -### **Tab bar settings** - -| Description | Code Snippet | Settings | -| ------------------------------ | ------------------------------------ | ------------------------------------------------------ | -| Hide/Show recents chats tab | `UIKitSettings.conversations = true` | You can show it using `true` or hide it using `false`. | -| Hide/Show calls tab | `UIKitSettings.calls = true` | You can show it using `true` or hide it using `false`. | -| Hide/Show users tab | `UIKitSettings.users = true` | You can show it using `true` or hide it using `false`. | -| Hide/Show groups tab | `UIKitSettings.groups = true` | You can show it using `true` or hide it using `false`. | -| Hide/Show user information tab | `UIKitSettings.userSettings = true` | You can show it using `true` or hide it using `false`. | - -*** - -### **Recent Chat settings** - -| Description | Code Snippet | Settings | -| ----------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------- | -| Show unread count | `UIKitSettings.unreadCount = true` | You can show it using `true` or hide it using `false`. | -| Show search bar in chats | `UIKitSettings.searchChats = true` | You can show it using `true` or hide it using `false`. | -| Show all users/groups or both | UIKitSettings.chatListMode = true' | You can show all users and groups using `true` or hide users and group using `false`. | - -*** - -### **Call settings** - -| Description | Code Snippet | Settings | -| --------------------------- | ------------------------------------------ | ------------------------------------------------------ | -| Enable audio call for user | `UIKitSettings.userAudioCall = true` | You can show it using `true` or hide it using `false`. | -| Enable audio call for group | `UIKitSettings.groupAudioCall = true` | You can show it using `true` or hide it using `false`. | -| Enable video call for user | `UIKitSettings.userVideoCall = true` | You can show it using `true` or hide it using `false`. | -| Enable video call for group | `UIKitSettings.groupVideoCall = true` | You can show it using `true` or hide it using `false`. | -| Enable sound for calls | `UIKitSettings.enableSoundForCalls = true` | You can show it using `true` or hide it using `false`. | - -*** - -### **User settings** - -| Description | Code Snippet | Settings | -| ---------------------- | --------------------------------------- | ------------------------------------------------------ | -| Show all users/friends | `UIKitSettings.userInMode = true` | You can show it using `true` or hide it using `false`. | -| Show user presence | `UIKitSettings.showUserPresence = true` | You can show it using `true` or hide it using `false`. | -| Show block user | `UIKitSettings.blockUser = true` | You can show it using `true` or hide it using `false`. | -| Show search user | `UIKitSettings.searchUsers = true` | You can show it using `true` or hide it using `false`. | -| Show view profile | `UIKitSettings.viewProfile = true` | You can show it using `true` or hide it using `false`. | - -*** - -### **Group settings** - -| Description | Code Snippet | Settings | -| --------------------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------ | -| Show create group | `UIKitSettings.groupCreation = true` | You can show it using `true` or hide it using `false`. | -| Show join or leave group | `UIKitSettings.joinOrLeaveGroup = true` | You can show it using `true` or hide it using `false`. | -| Show delete group | `UIKitSettings.allowDeleteGroup = true` | You can show it using `true` or hide it using `false`. | -| Show group members | `UIKitSettings.viewGroupMembers = true` | You can show it using `true` or hide it using `false`. | -| Show add member | `UIKitSettings.allowAddMembers = true` | You can show it using `true` or hide it using `false`. | -| Allow moderator to delete messages of participants | `UIKitSettings.allowModeratorToDeleteMemberMessages = true` | You can show it using `true` or hide it using `false`. | -| Allow user to kick members | `UIKitSettings.kickMember = true` | You can show it using `true` or hide it using `false`. | -| Allow user to ban members | `UIKitSettings.banMember = true` | You can show it using `true` or hide it using `false`. | -| Allow user to promote or demote members | `UIKitSettings.allowPromoteDemoteMembers = true` | You can show it using `true` or hide it using `false`. | -| Show public group option for creating groups. | `UIKitSettings.publicGroup = true` | You can show it using `true` or hide it using `false`. | -| Show private group option for creating groups. | `UIKitSettings.privateGroup = true` | You can show it using `true` or hide it using `false`. | -| Show password protected group option for creating groups. | `UIKitSettings.passwordGroup = true` | You can show it using `true` or hide it using `false`. | -| Show search groups | `UIKitSettings.searchGroups = true` | You can show it using `true` or hide it using `false`. | -| Enable message in private from Groups | `UIKitSettings.messageInPrivate = true` | You can show it using `true` or hide it using `false`. | -| Enable message receipt information from Groups | `UIKitSettings.messageInformation = true` | You can show it using `true` or hide it using `false`. | - -*** - -### **Message settings** - -| Description | Code Snippet | Settings | -| --------------------------------------------------------------------------- | ----------------------------------------------- | ------------------------------------------------------ | -| Show message composer for one-on-one chat | `UIKitSettings.sendMessageInOneOnOne = true` | You can show it using `true` or hide it using `false`. | -| Show message composer for group chat | `UIKitSettings.sendMessageInGroup = true` | You can show it using `true` or hide it using `false`. | -| Show send text message | `UIKitSettings.sendTextMessage = true` | You can show it using `true` or hide it using `false`. | -| Show send photos & videos | `UIKitSettings.sendPhotoVideos = true` | You can show it using `true` or hide it using `false`. | -| Show send files & documents | `UIKitSettings.sendFiles = true` | You can show it using `true` or hide it using `false`. | -| Show send voice notes | `UIKitSettings.sendVoiceNotes = true` | You can show it using `true` or hide it using `false`. | -| Show send emojis from keyboard | `UIKitSettings.sendEmojis = true` | You can show it using `true` or hide it using `false`. | -| Show send emojis in Larger Size | `UIKitSettings.sendEmojisInLargerSize = true` | You can show it using `true` or hide it using `false`. | -| Show send stickers | `UIKitSettings.sendStickers = true` | You can show it using `true` or hide it using `false`. | -| Send typing indicator | `UIKitSettings.sendTypingIndicator = true` | You can show it using `true` or hide it using `false`. | -| Send message reaction | `UIKitSettings.sendMessageReaction = true` | You can show it using `true` or hide it using `false`. | -| Send live reaction | `UIKitSettings.sendLiveReaction = true` | You can show it using `true` or hide it using `false`. | -| Ability to edit the message | `UIKitSettings.editMessage = true` | You can show it using `true` or hide it using `false`. | -| Ability to delete the message | `UIKitSettings.deleteMessage = true` | You can show it using `true` or hide it using `false`. | -| Ability to share, copy & forward the message | `UIKitSettings.shareCopyForwardMessage = true` | You can show it using `true` or hide it using `false`. | -| Ability to reply on message | `UIKitSettings.replyToMessage = true` | You can show it using `true` or hide it using `false`. | -| Ability to start new thread for message | `UIKitSettings.threadedChats = true` | You can show it using `true` or hide it using `false`. | -| Ability to share live reaction | `UIKitSettings.shareLiveReaction = true` | You can show it using `true` or hide it using `false`. | -| Ability to share your location | `UIKitSettings.shareLocation = true` | You can show it using `true` or hide it using `false`. | -| Show shared media | `UIKitSettings.viewShareMedia = true` | You can show it using `true` or hide it using `false`. | -| Show read/delivery receipts for Messages | `UIKitSettings.showReadDeliveryReceipts = true` | You can show it using `true` or hide it using `false`. | -| Ability to create poll (Poll Extension must be enabled from Dashboard) | `UIKitSettings.polls = true` | You can show it using `true` or hide it using `false`. | -| Enable sound for Messages | `UIKitSettings.enableSoundForMessages = true` | You can show it using `true` or hide it using `false`. | -| Enable Message Reactions | `UIKitSettings.messageReaction = true` | You can show it using `true` or hide it using `false`. | -| Enable Collaborative Document | `UIKitSettings.collaborativeDocument = true` | You can show it using `true` or hide it using `false`. | -| Enable Collaborative Whiteboard | `UIKitSettings.collaborativeWhiteboard = true` | You can show it using `true` or hide it using `false`. | -| Enable Message Translation | `UIKitSettings.messageTranslation = true` | You can show it using `true` or hide it using `false`. | -| Hide/show delete messages | `UIKitSettings.hideDeletedMessages = true` | You can show it using `true` or hide it using `false`. | -| Enable Message History | `UIKitSettings.messageHistory = true` | You can show it using `true` or hide it using `false`. | -| Show smart replies (Smart Replies Extension must be enabled from Dashboard) | `UIKitSettings.smartReplies = true` | You can show it using `true` or hide it using `false`. | - -*** diff --git a/ui-kit/kotlin/2.0/key-concepts.mdx b/ui-kit/kotlin/2.0/key-concepts.mdx deleted file mode 100644 index 844ce28c9..000000000 --- a/ui-kit/kotlin/2.0/key-concepts.mdx +++ /dev/null @@ -1,128 +0,0 @@ ---- -title: "Key Concepts" -description: "Key Concepts — CometChat documentation." ---- - -Version: v2 - -### **CometChat Dashboard** - -The CometChat Dashboard enables you to create new apps (projects) and manage your existing apps. - - -How many apps to create? - -Ideally, you should create two apps- one for development and one for production. And you should use a single app irrespective of the number of platforms. - -Do not create separate apps for every platform; if you do, your users on different platforms will not be able to communicate with each other! - - - -* For every app, a unique App ID is generated. This App ID will be required when integrating CometChat within your app. -* Along with the App ID, you will need to create an Auth Key (from the Dashboard) which can be used for user authentication. - -### **Auth & Rest API Keys** - -You can generate two types of keys from the dashboard. - -| Type | Privileges | Recommended Use | -| ------------ | ---------------------------------------------------------------- | --------------------------------------------- | -| Auth Key | The Auth Key can be used to create & login users. | In your client side code (during development) | -| Rest API Key | The Rest API Key can be used to perform any CometChat operation. | In your server side code | - -### **Users** - -A user is anyone who uses CometChat. - -### **UID** - -* Each user is uniquely identified using UID. -* The UID is typically the primary ID of the user from your database. -* The character limit for the UID is 100. - - - -UID can be alphanumeric with underscore and hyphen. Spaces, punctuation and other special characters are not allowed. - - - -### **Auth Token** - -* A single user can have multiple auth tokens. The auth tokens should be per user per device. -* It should be generated by API call ideally, via server to server call. The auth token should then be given to CometChat for login. -* An Auth Token can only be deleted via dashboard or using REST API. - -### **Authentication** - -To allow a user to use CometChat, the user must log in to CometChat. - -**CometChat does not handle user management.** You must handle user registration and login at your end. Once the user is logged into your app/site, you can log in the user to CometChat **programmatically**. So the user does not ever directly login to CometChat. - -**CometChat does not handle friends management.** If you want to associate friends with your users, you must handle friends management in your app. Once two users are friends (i.e. they have accepted each other as friends), then you can associate them as friends in CometChat. - -### **Typical Workflow** - -| Your App | Your Server | CometChat | -| ----------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | -| User registers in your app | You store the user information in your database (e.g. ID, name, email, phone, location etc. in `users` table) | You add the user to CometChat (only ID & name) using the Rest API | -| User logs in to your app | You verify the credentials, login the user and retrieve the user ID | You log in the user to CometChat using the same user ID programmatically | -| User sends a friend request | You display the request to the potential friend | No action required | -| User accepts a friend request | You display the users as friends | You add both the users as friends using the Rest API | - -### **User Roles** - -A role is a category for a group of similar users. For example, you may want to group your premium users using the role "Premium". You then use this to filter users or enable/disable features by writing conditional code. - -### **User List** - -* The User List can be used to build the **Contacts** or **Who's Online** view in your app. -* The list of users can be different based on the logged-in user. - -### **Groups** - -A group can be used for multiple users to communicate with each other on a particular topic/interest. - -### **GUID** - -* Each group is uniquely identified using GUID. -* The GUID is typically the primary ID of the group from your database. If you do not store group information in your database, you can generate a random string for use as GUID. -* The character limit for the GUID is 100. - - - -GUID can be alphanumeric with underscore and hyphen. Spaces, punctuation and other special characters are not allowed. - - - -### **Types** - -CometChat supports three different types of groups: - -| Type | Visibility | Participation | -| -------- | ---------------------------- | ------------------------------------------------- | -| Public | All users | Any user can choose to join | -| Password | All users | Any user with a valid password can choose to join | -| Private | Only users part of the group | Invited users will be auto-joined | - -### **Members** - -Once a participant joins a group, they become a member of the group. Members are part of the group indefinitely i.e. they will keep receiving messages, calls & notifications. To stop, the participant must either be kicked, banned or intentionally leave the group. - -CometChat supports three different types of member scopes in a group: - -| Member | Default | Privileges | -| ----------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Admin | Group creator is assigned Admin scope | - Change scope of Group Members to admin, moderator or participant.
- Can add members to a group.
- Kick & Ban Participants/Moderators/Admins
- Send & Receive Messages & Calls
- Update group
- Delete group | -| Moderator | - | - Change scope of moderator or participant.
- Update group
- Kick & Ban Participants
- Send & Receive Messages & Calls | -| Participant | Any other user is assigned Participant scope | - Send & Receive Messages & Calls | - -### **Messaging** - -Any message in CometChat can belong to either one of the below categories - -| Category | Description | -| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| message | Any message belonging to the category `message` can belong to either one of the below types:
1. text
2. image
3. video
4. audio
5. file | -| custom | Custom messages are an option available for developers to send custom data across to users/groups. To send any additional data that does not fit in the default categories and types provided by CometChat, you can use the custom messages. | -| action | Action messages are system-generated messages. These can belong to either of the below types:
1. groupMember - when the action is performed on a group member
2. message - when the action is performed on a message | -| call | These are call-related messages. These can belong to either one of the two types:
1. audio
2. video | diff --git a/ui-kit/kotlin/2.0/message-structure-and-hierarchy.mdx b/ui-kit/kotlin/2.0/message-structure-and-hierarchy.mdx deleted file mode 100644 index 0090cc7cf..000000000 --- a/ui-kit/kotlin/2.0/message-structure-and-hierarchy.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: "Message Structure And Hierarchy" -description: "Message Structure And Hierarchy — CometChat documentation." ---- - -Version: v2 - -The below diagram helps you better understand the various message categories and types that a CometChat message can belong to. - - - - - -As you can see in the above diagram, every message belongs to a particular category. A message can belong to either one of the 4 categories - -1. Message -2. Custom -3. Action -4. Call - -Each category can be further be classified into types. - -\#Message A message belonging to the category `message` can be classified into either 1 of the below types: - -1. text - A plain text message -2. image- An image message -3. video- A video message -4. audio- An audio message -5. file- A file message - -## **Custom** - -In the case of messages that belong to the `custom` category, there are no predefined types. Custom messages can be used by developers to send messages that do not fit in the default category and types provided by CometChat. For messages with the category `custom`, the developers can set their own type to uniquely identify the custom message. A very good example of a custom message would be the sharing of location co-ordinates. In this case, the developer can decide to use the custom message with type set to `location`. - -## **Action** - -Action messages are system-generated messages. Messages belonging to the `action` category can further be classified into one of the below types: - -1. groupMember - action performed on a group member. -2. message - action performed on a message. - -Action messages hold another property called `action` which actually determine the action that has been performed For the type `groupMember` the action can be either one of the below: - -1. joined - when a group member joins a group -2. left - when a group member leaves a group -3. kicked - when a group member is kicked from the group -4. banned - when a group member is banned from the group -5. unbanned - when a group member is unbanned from the group -6. added - when a user is added to the group -7. scopeChanged - When the scope of a group member is changed. - -For the type `message`, the action can be either one of the below: - -1. edited - when a message is edited. -2. deleted - when a message is deleted. - -## **Call** - -Messages with the category `call` are Calling related messages. These can belong to either one of the 2 types - -1. audio -2. video - -The call messages have a property called status that helps you figure out the status of the call. The status can be either one of the below values: - -1. initiated - when a is initiated to a user/group -2. ongoing - when the receiver of the call has accepted the call -3. canceled - when the call has been canceled by the initiator of the call -4. rejected - when the call has been rejected by the receiver of the call -5. unanswered - when the call was not answered by the receiver. -6. busy - when the receiver of the call was busy on another call. -7. ended - when the call was successfully completed and ended by either the initiator or receiver. diff --git a/ui-kit/kotlin/2.0/overview.mdx b/ui-kit/kotlin/2.0/overview.mdx deleted file mode 100644 index e7af62be9..000000000 --- a/ui-kit/kotlin/2.0/overview.mdx +++ /dev/null @@ -1,272 +0,0 @@ ---- -title: "Overview" -description: "Overview of Overview in CometChat." ---- - -Version: v2 - -The CometChat Android Kotlin UI Kit is developed to keep developers in mind and aims to reduce development efforts significantly. - - - - - -The UI Kit’s customizable UI components simplify the process of integrating text chat and voice/video calling features to your website or mobile application in a few minutes. - - - - -Follow the steps mentioned in the `README.md` file. - -Kindly, click on below button to download our Kotlin Chat UI Kit. - -[Kotlin Chat UI Kit](https://github.com/cometchat-pro/ui-kit/kotlin/archive/v2.zip)[View on Github](https://github.com/cometchat-pro/ui-kit/kotlin/tree/v2) - - - - -Import the app into Android Studio and follow the steps mentioned in the `README.md` file. - -Kindly, click on below button to download our Kotlin Sample App. - -[Kotlin Sample App](https://github.com/cometchat-pro/android-kotlin-chat-app/archive/v2.zip) - -[View on Github](https://github.com/cometchat-pro/android-kotlin-chat-app/tree/v2) - - - -## **Prerequisites** ⭐ - -Before you begin, ensure you have met the following requirements: - -✅ You have Android Studio installed on your machine. - -✅ You have an Android Device or Emulator with Android Version 6.0 or above. - -✅ You have read [Key Concepts](/ui-kit/kotlin/2.0/key-concepts). - -## **Installing Android Kotlin Chat UI Kit** - -### **Setup** 🔧 - -To install Android Kotlin UI Kit, you need to first register on CometChat Dashboard. [Click here to sign up.](https://app.cometchat.com/login) - -#### **Get your Application Keys** 🔑 - -* Create a new app -* Head over to the Quick Start or API & Auth Keys section and note the App ID, Auth Key, and Region. - - - - - -#### **Add the CometChat Dependency** - -First, add the repository URL to the **project level**`build.gradle` file in the repositories block under the `allprojects` section. - -```gradle -allprojects { - repositories { - maven { - url "https:__dl.cloudsmith.io_public_cometchat_cometchat-pro-android_maven_" - } - } -} -``` - -Open the **app level** `build.gradle` file and - -1. Add the below two line in the `dependencies` section. - -```gradle -dependencies { - implementation 'com.cometchat:pro-android-chat-sdk:2.4.1' - implementation 'com.cometchat:pro-android-calls-sdk:2.1.0' -} -``` - -2. Add the below lines `android` section - -```gradle -android { - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } -} -``` - -### **Configure CometChat inside your app** - -#### **Initialize CometChat** 🌟 - -The `init()` method initializes the settings required for CometChat. We suggest calling the init() method on app startup, preferably in the onCreate() method of the Application class. - - - -```kotlin -private val appID = "APP_ID" -private val region = "REGION" -val appSettings = AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(region).build() - -CometChat.init(this, appID, appSettings, object : CallbackListener() { - override fun onSuccess(successMessage: String) { - Log.d(TAG, "Initialization completed successfully") - } - - override fun onError(e: CometChatException) { - Log.d(TAG, "Initialization failed with exception: "+e.message) - } -}) -``` - - - - - - - -Make sure you replace the APP\_ID with your CometChat `APP ID` and REGION with your app's `REGION` in the above code. - - - -#### **Login User** 👤 - -The `login()` method returns the User object containing all the information of the logged-in user. - - - -```kotlin -private val UID = "cometchat-uid-1" // Replace with the UID of the user to login -private val AUTH_KEY = "Enter AUTH_KEY" // Replace with your App Auth Key -CometChat.login(UID, AUTH_KEY, object : CallbackListener() { - override fun onSuccess(user: User?) { - Log.d(TAG, "Login Successful : "+user.toString()) -} - - override fun onError(e: CometChatException) { - Log.d(TAG, "Login failed with exception: " + e.message); - } -}) -``` - - - - - - - -* Make sure you replace the `AUTH_KEY` with your CometChat AUTH Key in the above code. - -* We have setup 5 users for testing having UIDs: `cometchat-uid-1`, `cometchat-uid-2`, `cometchat-uid-3`, `cometchat-uid-4` and `cometchat-uid-5`. - - - -### **Add the UI Kit Library** - -To integrate the UI Kit, please follow the steps below: - -* Clone the UI Kit-Kotlin Library from the [android-kotlin-chat-ui-kit](https://github.com/cometchat-pro/ui-kit/kotlin) repository - -[**Download Kotlin UI Kit Library](https://github.com/cometchat-pro/ui-kit/kotlin/archive/v2.zip) - -* Import `uikit-kotlin` Module from Module Settings. -* If the Library is added successfully, it will look like mentioned in the below image. - - - - - -### **Configure UI Kit Library** - - -Enable dataBinding - -As the UI Kit uses dataBinding you must enable dataBinding - - - -To configure your app to use data binding, add the dataBinding element to your build.gradle file in the app module, as shown in the following example: - -```gradle -android { - ... - dataBinding { - enabled = true - } -} -``` - -We are using File Provider for storage & file access. So you need to add your application package name in manifestPlaceholders - -```gradle -android { - defaultConfig { - manifestPlaceholders = [file_provider: "YOUR_PACKAGE_NAME"] - __add your application package. - } -} -``` - - -Add Theme.MaterialComponents - -As UI Kit is using material components your app's theme should extend Theme.MaterialComponents. Follow the guide at Getting started with Material Components. - - - -Make sure you add the below dependency to your app-level build.gradle file - -```gradle -dependencies { - implementation 'com.google.android.material:material:1.2.0-alpha04' -} -``` - -The following is the list of Material Components themes you can use to get the latest component styles and theme-level attributes. - -`'Theme.MaterialComponents.NoActionBar'` - -`'Theme.MaterialComponents.Light.NoActionBar'` - -`Theme.MaterialComponents.DayNight.NoActionBar` - -Update your app theme to inherit from one of these themes, e.g.: - - - -```xml - -``` - - - - - -### **Launch CometChatUI** 🚀 - - - - - -**CometChatUI** is an option to launch a fully functional chat application using the UI Kit. In UI Kit all the UI Components are interlinked and work together to launch a fully functional chat on your mobile/application. - -To use CometChatUI user has to launch CometChatUI Activity. Add the following code snippet to launch `CometChatUI`. - - - -```kotlin -startActivity(Intent(this@YourActivity, CometChatUI::class.java)) -``` - - - - - -## **Checkout our sample app** - -Visit our [Kotlin sample app](https://github.com/cometchat-pro/android-kotlin-chat-app/tree/v2) repository to run the Kotlin sample app diff --git a/ui-kit/kotlin/2.0/ui-components.mdx b/ui-kit/kotlin/2.0/ui-components.mdx deleted file mode 100644 index 2096e00de..000000000 --- a/ui-kit/kotlin/2.0/ui-components.mdx +++ /dev/null @@ -1,1097 +0,0 @@ ---- -title: "UI Components" -description: "UI Components — CometChat documentation." ---- - -Version: v2 - -**UI Components** are building a block of the UI Kit. **UI Components** are a set of custom classes specially designed to build a feature-rich chat app. To achieve high customizability while building an app one can use the UI Components. There are different UI Components available in the UI Kit library. - -## **CometChatUI** - -**CometChatUI** is an option to launch a fully functional chat application using the UI Kit. In **CometChatUI** all the UI Components are interlinked and work together to launch a fully functional chat on your mobile application. - - - - - -CometChatUI is an Activity class, so you can launch `CometChatUI` using the below code snippet Make sure to add the following code snippet after `onSuccess` of CometChat login. - - - -```kotlin -startActivity(Intent(this@YourActivity, CometChatUI::class.java)) -``` - - - - - - - -Make sure that the above code snippet is added after `onSuccess` of CometChat login. - - - -*** - -## **CometChatConversationList** - -The **CometChatConversationList** is Fragment which will help you to display a list of recent conversations. The Fragment has all the necessary listeners and methods required to display the list of conversations. - -### **Usage** - -In your layout file (.xml file) add the following snippet to use the `CometChatConversationList`. Adding the following code snippet will give you a fully working list of conversations. - - - -```xml - -``` - - - - - - - - - - -Note About setItemClickListener on CometChatConversationList - -To get the click event of the list you must use `setItemClickListener`. The `setItemClickListener` has `OnItemClick()` to handle single click and `OnItemLongClick()` to handle long click events. - - - - - -```kotlin -cometChatConversationList.setItemClickListener(object : OnItemClickListener - - - -*** - -## **CometChatUserList** - -The `CometChatUserList` is a fragment with a List of users. The Fragment has all the necessary listeners and methods required to display the user's list. - -### **Usage** - -In your layout file (.xml file) add the following snippet to use the `CometChatUserList`. Adding the following code snippet will give you a fully working list of users. - - - -```xml - -``` - - - - - - - - - - -Note About setItemClickListener on CometChatUserList - -To get the click event of the list you must use `setItemClickListener`. The `setItemClickListener` has `OnItemClick()` to handle single click and `OnItemLongClick()` to handle long click events. - - - - - -```kotlin -cometChatUserList.setItemClickListener(object : OnItemClickListener() { - - override fun OnItemClick(t: Any, position: Int) { - - } - override fun OnItemLongClick(t: Any, position: Int) { - super.OnItemLongClick(t, position) - } - }) -``` - - - - - -*** - -## **CometChatGroupList** - -The `CometChatGroupList` is a fragment with a List of groups Fragment has all the necessary listeners and methods required to display the list of groups - -### **Usage** - -In your `layout.xml` add the following snippet to use the `CometChatGroupList`.Adding the following code snippet will give you a full working list of groups. - - - -```xml - -``` - - - - - - - - - - -Note About setItemClickListener on CometChatGroupList - -To get the click event of the list you must use `setItemClickListener`. The `setItemClickListener` has `OnItemClick()` to handle single click and `OnItemLongClick()` to handle long click events. - - - - - -```kotlin -cometChatGroupList.setItemClickListener(object : OnItemClickListener() { - - override fun OnItemClick(t: Any, position: Int) { - - } - override fun OnItemLongClick(t: Any, position: Int) { - super.OnItemLongClick(t, position) - } - }) -``` - - - - - -*** - -## **CometChatMessageList** - -`CometChatMessageList` is a fragment that consists of send and received messages. It is capable of sending and receiving different types of messages such as text, image, and documents. - -### **Usage** - -To use `CometChatMessageList` follow the below code snippets. `CometChatMessageList` is a dynamic so it will require some arguments. Add a `FrameLayout` in your `layout.xml` - - - -```kotlin -Intent intent = Intent(this@YOURACTIVITY, CometChatMessageListActivity::class.java); -intent.putExtra(UIKitConstants.IntentStrings.UID, user.getUid()); -intent.putExtra(UIKitConstants.IntentStrings.AVATAR, user.getAvatar()); -intent.putExtra(UIKitConstants.IntentStrings.STATUS, user.getStatus()); -intent.putExtra(UIKitConstants.IntentStrings.NAME, user.getName()); -intent.putExtra(UIKitConstants.IntentStrings.LINK,user.getLink()); -intent.putExtra(UIKitConstants.IntentStrings.TYPE, CometChatConstants.RECEIVER_TYPE_USER); -startActivity(intent); -``` - - - - - - - - - -In your activity set the required parameter in the following manner. - - - -```kotlin -val bundle = Bundle() -bundle.putString(UIKitContracts.IntentStrings.AVATAR, "AvatarUrl") -bundle.putString(UIKitContracts.IntentStrings.NAME,"Name") -bundle.putString(UIKitContracts.IntentStrings.TYPE,CometChatConstants.RECEIVER_TYPE_USER) -bundle.putString(UIKitContracts.IntentStrings.UID,"UID") -bundle.putString(UIKitContracts.IntentStrings.STATUS,"STATUS") -fragment.arguments = bundle -supportFragmentManager.beginTransaction().replace(R.id.ChatFragment, fragment).commit() -``` - - - - - -*** - -## **CometChatCallList** - -You can use the CometChatCallList to get a list of all the calls made by the logged-in user to other users and groups. - -### **Usage** - -Add the following code in your layout file (.xml file) - - - -```kotlin -Intent intent = Intent(this@YOURACTIVITY, CometChatMessageListActivity::class.java); -intent.putExtra(UIKitConstants.IntentStrings.UID, user.getUid()); -intent.putExtra(UIKitConstants.IntentStrings.AVATAR, user.getAvatar()); -intent.putExtra(UIKitConstants.IntentStrings.STATUS, user.getStatus()); -intent.putExtra(UIKitConstants.IntentStrings.NAME, user.getName()); -intent.putExtra(UIKitConstants.IntentStrings.LINK,user.getLink()); -intent.putExtra(UIKitConstants.IntentStrings.TYPE, CometChatConstants.RECEIVER_TYPE_USER); -startActivity(intent); -``` - - - - - - - - - -*** - -## **CometChatUserProfile** - -`CometChatUserProfile` is a fragment which provides detail about the currently logged-in user in the CometChat. - -### **Usage** - -Add the following code in your layout file (.xml file) - - - -```xml - -``` - - - - - - - - - -*** - -## **Shared** - -There are certain core components that are being used everywhere in `uiKit` library. You will find those components in `shared` folder under `ui_components`. Below are core components that are being used in `uiKit` library. - -### **CometChatAvatar** - -This is an image view customize only to display Avatar. This view can be used with image URLs as well as with CometChat objects like `User` and `Group` - - - - - -#### **Usage** - -In your `layout.xml` add the following code snippet. - - - -```xml - -``` - - - - - -Here `avatar_shape` is a static property. It should be either `circle` or `rectangle`. whereas the avatar URL needs to be set dynamically following is the sample code for the same. - - - -```kotlin -val avatar: CometChatAvatar = findViewById(R.id.av_user) -userViewHolder.avatar.setAvatarUrl("https://randomuser.me/api/portraits/women/44.jpg") -``` - - - - - -The CometChatAvatar Component works well with CometChat `User` and `Group` object. The `setAvatar()` method accepts `User` or `Group` object if Avatar of `User` or `Group` is not available it automatically show the initials of the user or group name as a placeholder Avatar. - - - - - - - - - -#### **Common Features** - -CometChat Avatar class provides functionality for an Avatar feature. There are commonly used properties to control the look of the Avatar. - -| CometChatAvatar field element | Relevant attributes/methods | -| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -| Avatar Shape | `app:avatar_shape` | -| Avatar | `app:avatar``# setAvatar(@NonNull User)``# setAvatar(@NonNull Group)``# setAvatar(@NonNull String)``# setAvatar(@NonNull Drawable, @NonNull String)` | -| Avatar Initial | `app:avatar_initials``# setInitials(@NonNull String)` | -| Border Color | `app:border_color` | -| Border Width | `app:border_width` | - -*** - -### **CometChatUserPresence** - -This view will be used to show the user status if the user is online or offline. This view will take user status and display the color accordingly. - - - - - -#### **Usage** - -In your `layout.xml` add the following code - - - -```xml - -``` - - - - - -User status can be set dynamically using the following code. - - - -```kotlin -val userPresence: CometChatUserPresence = findViewById(R.id.statusIndicator) - userViewHolder.statusIndicator.setUserStatus(user.status) -``` - - - - - -#### **Common Features** - -CometChatUserPresence provides `app:user_status` attribute and method `setUserStatus` to set Status of the user. - -The `app:user_status` attribute can also be used with DataBinding in the following manner - -e.g `app:user_status="@{user.status}"` you can also use different objects according to their use case. The attribute will continue to work as long as receives a string parameter - -| CometChatUserPresence field element | Relevant attributes/methods | -| ----------------------------------- | --------------------------------------------------- | -| User Status | `app:user_status``# setUserStatus(@NonNull String)` | - -*** - -### **CometChatBadgeCount** - -The CometChatBadgeCount component can be used to show an unread count. You can use it in different scenarios according to their use case. - - - - - -Add the following code to your `layout.xml` - - - -```xml - -``` - - - - - -The count can be set dynamically using the `setCount` method. The `setCount` method takes an int as a parameter. - - - -```kotlin -val badgeCount: CometChatBadgeCount = findViewById(R.id.badgecount) -holder.badgeCount.messageCount.setCount(conversation.unreadMessageCount) -``` - - - - - -#### **Common Feature** - -The CometChatBadgeCount component provides different attributes and methods to control the behavior and appearance of the BadgeCount view. - -The attribute `app: count` can also be used with DataBinding - - - -```xml -/// example with conversation object - - -``` - - - - - -| CometChatBadgeCount field element | Relevant attributes/methods | -| --------------------------------- | ------------------------------------------------------------------- | -| Count | `app:count``# setCount(int)` | -| Count Size | `app:count_size``# setCountSize(float)` | -| Count Background Color | `app:count_background_color``# setCountBackground(@ColorRes color)` | -| Count Color | `app:count_color``setCountSize(float)` | - -*** - -### **CometChatUsers** - -The `CometChatUsers` is custom **RecyclerView** which helps to display a list of users present in your CometChat app. - - - - - - -Note about CometChatUsers using with DataBinding: - -Your project should have DataBinding enabled. You can use `CometChatUsers` using DataBinding in the following manner - - - -In your `layout.xml` add the following code : - - - -```xml - - - - - - - - - - -``` - - - - - -In your corresponding activity or fragment add the following code - - - -```kotlin -val userList: ObservableArrayList = ObservableArrayList() -binding.setUserList(userList) -``` - - - - - -For getting the list of users you can use `UsersRequestBuilder()`. Visit the below link for more details on how to retrieve a list of users. - -In `onSuccess` of the `fetchNext` method you can set the data the `ObservableArrayList` you have created. The advantage of using the `ObservableArrayList` is one doesn't have to manually set the data on `binding.setUserList(userList);` every time you get a new set of data. - - - -```kotlin -usersRequest.fetchNext(object : CallbackListener>() { - public override fun onSuccess(list: List) { - Log.d(TAG, "User list received: " + list.size) - userList.addAll(list) - //update the ObservableArrayList here - } - - public override fun onError(e: CometChatException) { - Log.d(TAG, "User list fetching failed with exception: " + e.message) - } - }) -``` - - - - - - -Note About CometChatUsers Without DataBinding - -If you are not using DataBinding in your project you can use the `CometChatUser` in the following manner. - - - -In your `layout.xml` add the following code - - - -```xml - -``` - - - - - -In your corresponding activity or fragment. - - - -```kotlin -var cometChatUsers: CometChatUsers = findViewById(R.id.cometchatUsers); -cometChatUser.setUserList(list); -// list: fetched using the UsersRequestBuilder -``` - - - - - -To get the list of users you can use UsersRequestBuilder(). Visit the link below for more details on [Retrieve Users](/sdk/android/2.0/retrieve-users) - - -Note About Using setItemClickListener - -For getting the click event of `CometChatUsers` you can make use of `setItemClickListener` class. - - - - - -```kotlin -cometChatUsers.setItemClickListener(object : OnItemClickListener() { - - override fun OnItemClick(t: Any, position: Int) { - - } - override fun OnItemLongClick(t: Any, position: Int) { - super.OnItemLongClick(t, position) - } - }) -``` - - - - - -#### **Common Usage** - -The `CometChatUser` component provides different properties to control the behavior of `CometChatUser` view. - -| CometChatUser field elements | Relevant attributes/methods | -| ---------------------------- | --------------------------- | -| Update List | `# setUserList(List)` | -| Update | `# update (User)` | -| Remove | `# remove(String)` | -| Add | `# add(User)` | - -*** - -### **CometChatGroups** - -The `CometChatGroups` is a custom **RecyclerView** that helps you to display a list of groups. - - - - - -*** - - -Note About CometChatGroups Using With DataBinding - -If you are using DataBinding in your project you can use the `CometChatGroups` in the following manner. - - - -In your `layout.xml` add the following code snippet - - - -```xml - - - - - - - - - - - -``` - - - - - -In your corresponding activity or fragment . - - - -```kotlin -val groupList: ObservableArrayList = ObservableArrayList() -binding.setGroupList(groupList) -``` - - - - - -For getting the list of groups you can use `GroupsRequestBuilder()`.Visit the below link for more details on how to retrieve a list of group. - -In `onSuccess` of the `fetchNext` method you can set the data the `ObservableArrayList` you have created. The advantage of using the `ObservableArrayList` is one doesn't have to manually set the data on `binding.setGroupList(groupList);` every time you get a new set of data. - - - -```kotlin -groupsRequest.fetchNext(object : CallbackListener>() { - public override fun onSuccess(list: List) { - Log.d(TAG, "Groups list fetched successfully: " + list.size); - groupList.addAll(list) - // update the ObservableArrayList here - } - - public override fun onError(e: CometChatException) { - Log.d(TAG, "Groups list fetching failed with exception: " + e.message); - } - }) -``` - - - - - - -Note About CometChatGroups Without DataBinding - -If you are not using DataBinding in your project you can use the `CometChatGroups` in the following manner. - - - -In your `layout.xml` add the following code - - - -```xml - -``` - - - - - -In your corresponding activity or fragment - - - -```kotlin -val cometChatGroups: CometChatGroups = findViewById(R.id.cometchatGroupList) - cometChatGroups.setGroupList(list) - // list: fetched using the GroupsRequestBuilder -``` - - - - - -You can refer to how to [Retrieve Groups](/sdk/android/2.0/retrieve-groups). - - -Note About Using setItemClickListener - -For getting the click event of `CometChatGroups` you can make use of `setItemClickListener` class. - - - - - -```kotlin -cometChatGroups.setItemClickListener(object : OnItemClickListener() { - - override fun OnItemClick(t: Any, position: Int) { - - } - override fun OnItemLongClick(t: Any, position: Int) { - super.OnItemLongClick(t, position) - } - }) -``` - - - - - -#### **Common Usage** - -The `CometChatGroups` component provides different properties to control the behavior of `CometChatGroups` view. You can perform different operations like an update, remove, add, etc. - -| CometChatGroups field elements | Relevant attributes/methods | -| ------------------------------ | ----------------------------- | -| Update List | `# setGroupList(List)` | -| Update | `# update (Group)` | -| Remove | `# remove(String)` | -| Add | `# add(Group)` | - -*** - -### **CometChatConversations** - -`CometChatConversations` is a custom **RecyclerView** which will help you to display a list of all the users and groups in which the logged-in user has made any conversation. - - - - - - -Note about CometChatConversations using with DataBinding - -If you are using DataBinding in your project you can use the `CometChatConversations` in the following manner. - - - -In your `layout.xml` add the following code. - - - -```xml - - - - - - - - - - - -``` - - - - - -In your corresponding activity or fragment. - - - -```kotlin -val conversationList: ObservableArrayList = ObservableArrayList() -binding.setConversationList(conversationList) -``` - - - - - -For getting the list of conversation you can use `ConversationsRequestBuilder()` .visit the below link for more details on how to retrieve a list of conversation - -In `onSuccess` of the `fetchNext` method you can set the data the `ObservableArrayList` you have created. The advantage of using the `ObservableArrayList` is one doesn't have to manually set the data on `binding.setConversationList(conversationList);` every time you get a new set of data. - - - -```kotlin -conversationsRequest.fetchNext(object : CallbackListener>() { - override fun onSuccess(conversations: List) { - // Handle list of conversations - conversationList.addAll(conversations) - // update ObservableArrayList list here - } - - override fun onError(e: CometChatException) { - // Handle failure - Log.d(TAG, "onError: " + e.message) - } - }) -``` - - - - - - -Note About CometChatConversations Without DataBinding - -If you are not using DataBinding in your project you can use the `CometChatConversations` in the following manner. - - - -In your `layout.xml` add the following code - - - -```xml - -``` - - - - - -In your corresponding activity or fragment - - - -```kotlin -val cometChatConversations: CometChatConversations = findViewById(R.id.cometchatConversations); - -cometChatConversationList.setConversationList(conversations); -// list: fetched using the ConversationsRequestBuilder -``` - - - - - -In `onSuccess` of the `fetchNext` method of `ConversationsRequestBuilder`, you can set the data. You can refer how to [Retrieve Conversations](/sdk/android/2.0/retrieve-conversations) - - -Note About Using setItemClickListener - -For getting the click event of `CometChatConversations` you can make use of the `ConversationItemClickListener` class. - - - - - -```kotlin -cometChatConversations.setItemClickListener(object : OnItemClickListener() { - - override fun OnItemClick(t: Any, position: Int) { - - } - override fun OnItemLongClick(t: Any, position: Int) { - super.OnItemLongClick(t, position) - } - }) -``` - - - - - -#### **Common Usage** - -The `CometChatConversations` component provides different properties to control the behavior of the `CometChatConversations` view. You can perform different operations like an update, remove, add, etc - -| CometChatConversations field elements | Relevant attributes/methods | -| ------------------------------------- | ------------------------------------------- | -| Update List | `# setConversationList(List)` | -| Update | `# update (Conversation)` | -| Remove | `# remove(Conversation)` | -| Add | `# add(Conversation)` | - -*** - -### **CometChatCalls** - -`CometChatCalls` is custom **RecyclerView** which will help you to display list of calls. - - - - - -You can use the `CometChatCalls` in the following manner. - -In your `layout.xml` add the following code : - - - -```xml - -``` - - - - - -In your corresponding activity or fragment - - - -```kotlin -val cometChatCalls: CometChatCalls = findViewById(R.id.cometchatCalls); -``` - - - - - -In `onSuccess` of the `fetchNext` method of `MessagesRequestBuilder` you can set the data. You need to add `setCategory(CometChatConstants.CATEGORY_CALL)` in your `MessagesRequestBuilder` to fetch only call messages - -You can refer an **example here.** - - - -```kotlin -if (messagesRequest == null) -{ -messagesRequest = MessagesRequestBuilder().setCategory(CometChatConstants.CATEGORY_CALL).setLimit(30).build() - } -messagesRequest.fetchPrevious(object : CallbackListener>() { - override fun onSuccess(baseMessages: List) { - /*Since the call list received like messages i.e top with older and - bottom with the latest message. We will reverse the list */ - Collections.reverse(baseMessages) - cometCallList.setCallList(baseMessages) - } - - override fun onError(e: CometChatException) { - //Error Message - Log.e("onError: ", e.message) - } -}) -``` - - - - - - -Note About Using CallItemClickListener: - -For getting the click event of `CometChatCalls` you can make use of `ItemClickListener` class. - - - -There are two events given by `CometChatCalls`. - -This event is performed when clicking on the User or Group item displayed in the call list. - - - -```kotlin -cometChatCalls.setItemClickListener(object : OnItemClickListener() { - override fun OnItemClick(t: Any, position: Int) { - // perform your action here - } - }) -``` - - - - - -This event is performed when click on call icon visible after each Group or User item in call list. - - - -```kotlin -cometChatCalls.setItemCallClickListener(object : OnItemClickListener() { - override fun OnItemClick(t: Any, position: Int) { - // perform your action here - } - }) -``` - - - - - -#### **Common Usage:** - -The `CometChatCalls` component provides different properties to control the behavior of the `CometChatCalls` view. You can perform different operations like an update, remove. - -| CometChatCalls field e | Relevant attributes/methods | -| ---------------------- | --------------------------- | -| Update List | setCallList(List) | -| Update | update (Call) | -| Remove | remove(Call) | diff --git a/ui-kit/kotlin/customize-ui-kit.mdx b/ui-kit/kotlin/customize-ui-kit.mdx deleted file mode 100644 index 77be3515d..000000000 --- a/ui-kit/kotlin/customize-ui-kit.mdx +++ /dev/null @@ -1,138 +0,0 @@ ---- -title: "Customize UI Kit" -description: "Customize UI Kit — CometChat documentation." ---- - - - - - -This guide helps you to customize, modify, and enable/disable features present in UI Kit. - - - -CometChat SDK & UI Kit both need to be configured before starting the customization in UI Kit. - -## ::: - -To Modify and customize UI Kit, you need to refer to the `UIKitSettings` class present in the UI Kit Library. You will be easily able to modify the color, enable/disable some of the features which you won't require in your app. - -important - -* UI Kit Settings must be called before launching any UI Screen or UI Unified. By default, all settings will be enabled. -* For advanced level customization, you can modify the source code of the library as per your requirement. - - - -**1. Color Settings** - -| Sr No | Description | Code Snippet | Settings | -| ----- | --------------------- | ------------------------------- | --------------------------------------------------- | -| 1. | Modify primary colour | `UIKitSettings.color = #F3F3F3` | Requires Hex value of color as String

Ex: "#F3F3F3" | - -*** - -**2. Tab bar settings** - -| Sr No | Description | Code Snippet | Settings | -| ----- | ------------------------------ | ------------------------------------ | ------------------------------------------------------ | -| 1. | Hide/Show recents chats tab | `UIKitSettings.conversations = true` | You can show it using `true` or hide it using `false`. | -| 2. | Hide/Show calls tab | `UIKitSettings.calls = true` | You can show it using `true` or hide it using `false`. | -| 3. | Hide/Show users tab | `UIKitSettings.users = true` | You can show it using `true` or hide it using `false`. | -| 4. | Hide/Show groups tab | `UIKitSettings.groups = true` | You can show it using `true` or hide it using `false`. | -| 5. | Hide/Show user information tab | `UIKitSettings.userSettings = true` | You can show it using `true` or hide it using `false`. | - -*** - -**3. Recent chat settings** - -| Sr No | Description | Code Snippet | Settings | -| ----- | ----------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------- | -| 1. | Show unread count | `UIKitSettings.unreadCount = true` | You can show it using `true` or hide it using `false`. | -| 2. | Show search bar in chats | `UIKitSettings.searchChats = true` | You can show it using `true` or hide it using `false`. | -| 3. | Show all users/groups or both | UIKitSettings.chatListMode = true' | You can show all users and groups using `true` or hide users and group using `false`. | - -*** - -**4. Call settings** - -| Description | Code Snippet | Settings | -| --------------------------- | ------------------------------------------ | ------------------------------------------------------ | -| Enable audio call for user | `UIKitSettings.userAudioCall = true` | You can show it using `true` or hide it using `false`. | -| Enable audio call for group | `UIKitSettings.groupAudioCall = true` | You can show it using `true` or hide it using `false`. | -| Enable video call for user | `UIKitSettings.userVideoCall = true` | You can show it using `true` or hide it using `false`. | -| Enable video call for group | `UIKitSettings.groupVideoCall = true` | You can show it using `true` or hide it using `false`. | -| Enable sound for calls | `UIKitSettings.enableSoundForCalls = true` | You can show it using `true` or hide it using `false`. | - -*** - -**5**. **User settings** - -| Sr No | Description | Code Snippet | Settings | -| ----- | ---------------------- | --------------------------------------- | ------------------------------------------------------ | -| 1. | Show all users/friends | `UIKitSettings.userInMode = true` | You can show it using `true` or hide it using `false`. | -| 2. | Show user presence | `UIKitSettings.showUserPresence = true` | You can show it using `true` or hide it using `false`. | -| 3. | Show block user | `UIKitSettings.blockUser = true` | You can show it using `true` or hide it using `false`. | -| 4. | Show search user | `UIKitSettings.searchUsers = true` | You can show it using `true` or hide it using `false`. | -| 5. | Show view profile | `UIKitSettings.viewProfile = true` | You can show it using `true` or hide it using `false`. | - -*** - -**6. Group settings** - -| Sr No | Description | Code Snippet | Settings | -| ----- | --------------------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------ | -| 1. | Show create group | `UIKitSettings.groupCreation = true` | You can show it using `true` or hide it using `false`. | -| 2. | Show join or leave group | `UIKitSettings.joinOrLeaveGroup = true` | You can show it using `true` or hide it using `false`. | -| 3. | Show delete group | `UIKitSettings.allowDeleteGroup = true` | You can show it using `true` or hide it using `false`. | -| 4. | Show group members | `UIKitSettings.viewGroupMembers = true` | You can show it using `true` or hide it using `false`. | -| 5. | Show add member | `UIKitSettings.allowAddMembers = true` | You can show it using `true` or hide it using `false`. | -| 6. | Allow moderator to delete messages of participants | `UIKitSettings.allowModeratorToDeleteMemberMessages = true` | You can show it using `true` or hide it using `false`. | -| 7. | Allow user to kick members | `UIKitSettings.kickMember = true` | You can show it using `true` or hide it using `false`. | -| 8. | Allow user to ban members | `UIKitSettings.banMember = true` | You can show it using `true` or hide it using `false`. | -| 9. | Allow user to promote or demote members | `UIKitSettings.allowPromoteDemoteMembers = true` | You can show it using `true` or hide it using `false`. | -| 10. | Show public group option for creating groups. | `UIKitSettings.publicGroup = true` | You can show it using `true` or hide it using `false`. | -| 11. | Show private group option for creating groups. | `UIKitSettings.privateGroup = true` | You can show it using `true` or hide it using `false`. | -| 12. | Show password protected group option for creating groups. | `UIKitSettings.passwordGroup = true` | You can show it using `true` or hide it using `false`. | -| 13. | Show search groups | `UIKitSettings.searchGroups = true` | You can show it using `true` or hide it using `false`. | -| 14. | Enable message in private from Groups | `UIKitSettings.messageInPrivate = true` | You can show it using `true` or hide it using `false`. | -| 15. | Enable message receipt information from Groups | `UIKitSettings.messageInformation = true` | You can show it using `true` or hide it using `false`. | - -*** - -**7. Message settings** - -| Sr No | Description | Code Snippet | Settings | -| ----- | --------------------------------------------------------------------------- | ----------------------------------------------- | ------------------------------------------------------ | -| 1. | Show message composer for one-on-one chat | `UIKitSettings.sendMessageInOneOnOne = true` | You can show it using `true` or hide it using `false`. | -| 2. | Show message composer for group chat | `UIKitSettings.sendMessageInGroup = true` | You can show it using `true` or hide it using `false`. | -| 3 | Show send text message | `UIKitSettings.sendTextMessage = true` | You can show it using `true` or hide it using `false`. | -| 4. | Show send photos & videos | `UIKitSettings.sendPhotoVideos = true` | You can show it using `true` or hide it using `false`. | -| 5. | Show send files & documents | `UIKitSettings.sendFiles = true` | You can show it using `true` or hide it using `false`. | -| 6. | Show send voice notes | `UIKitSettings.sendVoiceNotes = true` | You can show it using `true` or hide it using `false`. | -| 7. | Show send emojis from keyboard | `UIKitSettings.sendEmojis = true` | You can show it using `true` or hide it using `false`. | -| 8. | Show send emojis in Larger Size | `UIKitSettings.sendEmojisInLargerSize = true` | You can show it using `true` or hide it using `false`. | -| 9. | Show send stickers | `UIKitSettings.sendStickers = true` | You can show it using `true` or hide it using `false`. | -| 10. | Send typing indicator | `UIKitSettings.sendTypingIndicator = true` | You can show it using `true` or hide it using `false`. | -| 11. | Send message reaction | `UIKitSettings.sendMessageReaction = true` | You can show it using `true` or hide it using `false`. | -| 12. | Send live reaction | `UIKitSettings.sendLiveReaction = true` | You can show it using `true` or hide it using `false`. | -| 13.. | Ability to edit the message | `UIKitSettings.editMessage = true` | You can show it using `true` or hide it using `false`. | -| 14. | Ability to delete the message | `UIKitSettings.deleteMessage = true` | You can show it using `true` or hide it using `false`. | -| 15. | Ability to share, copy & forward the message | `UIKitSettings.shareCopyForwardMessage = true` | You can show it using `true` or hide it using `false`. | -| 16. | Ability to reply on message | `UIKitSettings.replyToMessage = true` | You can show it using `true` or hide it using `false`. | -| 17. | Ability to start new thread for message | `UIKitSettings.threadedChats = true` | You can show it using `true` or hide it using `false`. | -| 18. | Ability to share live reaction | `UIKitSettings.shareLiveReaction = true` | You can show it using `true` or hide it using `false`. | -| 19. | Ability to share your location | `UIKitSettings.shareLocation = true` | You can show it using `true` or hide it using `false`. | -| 20. | Show shared media | `UIKitSettings.viewShareMedia = true` | You can show it using `true` or hide it using `false`. | -| 21. | Show read/delivery receipts for Messages | `UIKitSettings.showReadDeliveryReceipts = true` | You can show it using `true` or hide it using `false`. | -| 22. | Ability to create poll (Poll Extension must be enabled from Dashboard) | `UIKitSettings.polls = true` | You can show it using `true` or hide it using `false`. | -| 23. | Enable sound for Messages | `UIKitSettings.enableSoundForMessages = true` | You can show it using `true` or hide it using `false`. | -| 24. | Enable Message Reactions | `UIKitSettings.messageReaction = true` | You can show it using `true` or hide it using `false`. | -| 20. | Enable Collaborative Document | `UIKitSettings.collaborativeDocument = true` | You can show it using `true` or hide it using `false`. | -| 25. | Enable Collaborative Whiteboard | `UIKitSettings.collaborativeWhiteboard = true` | You can show it using `true` or hide it using `false`. | -| 22. | Enable Message Translation | `UIKitSettings.messageTranslation = true` | You can show it using `true` or hide it using `false`. | -| 26. | Hide/show delete messages | `UIKitSettings.hideDeletedMessages = true` | You can show it using `true` or hide it using `false`. | -| 27. | Enable Message History | `UIKitSettings.messageHistory = true` | You can show it using `true` or hide it using `false`. | -| 28. | Show smart replies (Smart Replies Extension must be enabled from Dashboard) | `UIKitSettings.smartReplies = true` | You can show it using `true` or hide it using `false`. | - -*** diff --git a/ui-kit/kotlin/key-concepts.mdx b/ui-kit/kotlin/key-concepts.mdx deleted file mode 100644 index 6f1ae61b7..000000000 --- a/ui-kit/kotlin/key-concepts.mdx +++ /dev/null @@ -1,127 +0,0 @@ ---- -title: "Key Concepts" -description: "Key Concepts — CometChat documentation." ---- - -### **CometChat Dashboard** - -The CometChat Dashboard enables you to create new apps (projects) and manage your existing apps. - - -How many apps to create? - -Ideally, you should create two apps- one for development and one for production. And you should use a single app irrespective of the number of platforms. - -Do not create separate apps for every platform; if you do, your users on different platforms will not be able to communicate with each other! - - - -* For every app, a unique App ID is generated. This App ID will be required when integrating CometChat within your app. -* Along with the App ID, you will need to create an Auth Key (from the Dashboard) which can be used for user authentication. - -### **Auth & Rest API Keys** - -You can generate two types of keys from the dashboard. - -| Type | Privileges | Recommended Use | -| ------------ | ---------------------------------------------------------------- | --------------------------------------------- | -| Auth Key | The Auth Key can be used to create & login users. | In your client side code (during development) | -| Rest API Key | The Rest API Key can be used to perform any CometChat operation. | In your server side code | - -### **Users** - -A user is anyone who uses CometChat. - -### **UID** - -* Each user is uniquely identified using UID. -* The UID is typically the primary ID of the user from your database. -* The character limit for the UID is 100. - - - -UID can be alphanumeric with underscore and hyphen. Spaces, punctuation and other special characters are not allowed. - - - -### **Auth Token** - -* A single user can have multiple auth tokens. The auth tokens should be per user per device. -* It should be generated by API call ideally, via server to server call. The auth token should then be given to CometChat for login. -* An Auth Token can only be deleted via dashboard or using REST API. - -### **Authentication** - -To allow a user to use CometChat, the user must log in to CometChat. - -**CometChat does not handle user management.** You must handle user registration and login at your end. Once the user is logged into your app/site, you can log in the user to CometChat **programmatically**. So the user does not ever directly login to CometChat. - -**CometChat does not handle friends management.** If you want to associate friends with your users, you must handle friends management in your app. Once two users are friends (i.e. they have accepted each other as friends), then you can associate them as friends in CometChat. - -### **Typical Workflow** - -| Your App | Your Server | CometChat | -| ----------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | -| User registers in your app | You store the user information in your database (e.g. ID, name, email, phone, location etc. in `users` table) | You add the user to CometChat (only ID & name) using the Rest API | -| User logs in to your app | You verify the credentials, login the user and retrieve the user ID | You log in the user to CometChat using the same user ID programmatically | -| User sends a friend request | You display the request to the potential friend | No action required | -| User accepts a friend request | You display the users as friends | You add both the users as friends using the Rest API | - -### **User Roles** - -A role is a category for a group of similar users. For example, you may want to group your premium users using the role "Premium". You then use this to filter users or enable/disable features by writing conditional code. - -### **User List** - -* The User List can be used to build the **Contacts** or **Who's Online** view in your app. -* The list of users can be different based on the logged-in user. - -### **Groups** - -A group can be used for multiple users to communicate with each other on a particular topic/interest. - -### **GUID** - -* Each group is uniquely identified using GUID. -* The GUID is typically the primary ID of the group from your database. If you do not store group information in your database, you can generate a random string for use as GUID. -* The character limit for the GUID is 100. - - -Warning - -GUID can be alphanumeric with underscore and hyphen. Spaces, punctuation and other special characters are not allowed. - - - -### **Types** - -CometChat supports three different types of groups: - -| Type | Visibility | Participation | -| -------- | ---------------------------- | ------------------------------------------------- | -| Public | All users | Any user can choose to join | -| Password | All users | Any user with a valid password can choose to join | -| Private | Only users part of the group | Invited users will be auto-joined | - -### **Members** - -Once a participant joins a group, they become a member of the group. Members are part of the group indefinitely i.e. they will keep receiving messages, calls & notifications. To stop, the participant must either be kicked, banned or intentionally leave the group. - -CometChat supports three different types of member scopes in a group: - -| Member | Default | Privileges | -| ----------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Admin | Group creator is assigned Admin scope | - Change scope of Group Members to admin, moderator or participant.
- Can add members to a group.
- Kick & Ban Participants/Moderators/Admins
- Send & Receive Messages & Calls
- Update group
- Delete group | -| Moderator | - | - Change scope of moderator or participant.
- Update group
- Kick & Ban Participants
- Send & Receive Messages & Calls | -| Participant | Any other user is assigned Participant scope | - Send & Receive Messages & Calls | - -### **Messaging** - -Any message in CometChat can belong to either one of the below categories - -| Category | Description | -| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| message | Any message belonging to the category `message` can belong to either one of the below types:
1. text
2. image
3. video
4. audio
5. file | -| custom | Custom messages are an option available for developers to send custom data across to users/groups. To send any additional data that does not fit in the default categories and types provided by CometChat, you can use the custom messages. | -| action | Action messages are system-generated messages. These can belong to either of the below types:
1. groupMember - when the action is performed on a group member
2. message - when the action is performed on a message | -| call | These are call-related messages. These can belong to either one of the two types:
1. audio
2. video | diff --git a/ui-kit/kotlin/overview.mdx b/ui-kit/kotlin/overview.mdx deleted file mode 100644 index 5091da019..000000000 --- a/ui-kit/kotlin/overview.mdx +++ /dev/null @@ -1,327 +0,0 @@ ---- -title: "Overview" -description: "Overview of Overview in CometChat." ---- - -The CometChat Kotlin Chat UI Kit lets Android developers integrate fully featured text chat & voice/video calling into mobile apps seamlessly. - - - - - - -Improvements in v3.0 - -* Faster connection & response times -* Higher rate limits -* Supports up to 100K users in a group -* Unlimited groups -* Support for Transient Messages -* Real-time user & group members count And more! - - - -The Kotlin Chat UI Kit’s fully customizable UI components simplify the process of integrating text chat and voice/video calling features to your Android mobile application. - - - - -Follow the steps mentioned in the `README.md` file. - -Kindly, click on below button to download our Android Kotlin Chat UI Kit. - -[Kotlin Chat UI Kit](https://github.com/cometchat/cometchat-uikit-android/tree/v3) - -[View on Github](https://github.com/cometchat/cometchat-uikit-android/tree/v3) - - - - -Import the app into Android Studio and follow the steps mentioned in the `README.md` file. - -Kindly, click on below button to download our Java Sample App. - -[Kotlin Sample App](https://github.com/cometchat-pro/android-kotlin-chat-app/archive/v3.zip) - -[View on Github](https://github.com/cometchat-pro/android-kotlin-chat-app/tree/v3) - - - -## **Prerequisites** ⭐ - -Before you begin, ensure you have met the following requirements: - -✅ You have Android Studio installed on your machine. - -✅ You have an Android Device or Emulator with Android Version 6.0 or above. - -✅ You have read [Key Concepts](/ui-kit/kotlin/key-concepts). - -## **Installing Android Kotlin Chat UI Kit** - -### **Setup** 🔧 - -To install Android Kotlin UI Kit, you need to first register on CometChat Dashboard. [Click here to sign up.](https://app.cometchat.com/login) - -#### **Get your Application Keys** 🔑 - -* Create a new app -* Head over to the Quick Start or API & Auth Keys section and note the App ID, Auth Key, and Region. - - - - - -#### **Add the CometChat Dependency** - -First, add the repository URL to the **project level**`build.gradle` file in the repositories block under the `allprojects` section. - - - -```gradle -allprojects { - repositories { - maven { - url "https://dl.cloudsmith.io/public/cometchat/cometchat-pro-android/maven/" - } - } -} -``` - - - - - -Open the **app level** `build.gradle` file and - -1. Add the below two line in the `dependencies` section. - - - -```gradle -dependencies { - implementation 'com.cometchat:pro-android-chat-sdk:3.0.0' - - /*v2.4+ onwards, Voice & Video Calling functionality has been - moved to a separate library. In case you plan to use the calling feature, - please add the Calling dependency*/ - - implementation 'com.cometchat:pro-android-calls-sdk:2.1.0' -} -``` - - - - - -2. Add the below lines `android` section - - - -```gradle -android { - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } -} -``` - - - - - -You can refer to the below link for instructions on how to do so: - -**[📝 Add CometChat Dependency](/sdk/android/setup)** `Documentation` - -### **Configure CometChat inside your app** - -#### **Initialize CometChat** 🌟 - -The `init()` method initializes the settings required for CometChat. Please make sure to call this method before calling any other methods from CometChat SDK. - - - -```kotlin -private val appID = "APP_ID" -private val region = "REGION" -val appSettings = AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(region).build() - -CometChat.init(this, appID, appSettings, object : CallbackListener() { - override fun onSuccess(successMessage: String) { - Log.d(TAG, "Initialization completed successfully") - } - - override fun onError(e: CometChatException) { - Log.d(TAG, "Initialization failed with exception: "+e.message) - } -}) -``` - - - - - - - -Make sure you replace the APP\_ID with your CometChat APP ID and REGION with your app's REGION in the above code. - - - -#### **Login User** 👤 - -The `login()` method returns the User object containing all the information of the logged-in user. - - - -```kotlin -private val UID = "cometchat-uid-1" // Replace with the UID of the user to login -private val AUTH_KEY = "Enter AUTH_KEY" // Replace with your App Auth Key -CometChat.login(UID, AUTH_KEY, object : CallbackListener() { - override fun onSuccess(user: User?) { - Log.d(TAG, "Login Successful : "+user.toString()) - } - - override fun onError(e: CometChatException) { - Log.d(TAG, "Login failed with exception: " + e.message); - } -}) -``` - - - - - - - -Make sure you replace the AUTH\_KEY with your CometChat AUTH Key in the above code. We have setup 5 users for testing having UIDs: cometchat-uid-1, cometchat-uid-2, cometchat-uid-3, cometchat-uid-4 and cometchat-uid-5. - - - -### **Add the Android Kotlin UI Kit Library** - -To integrate the UI Kit, please follow the steps below: - -* Clone the UI Kit-Kotlin Library from the [android-kotlin-chat-ui-kit](https://github.com/cometchat/cometchat-uikit-android/tree/v3) repository - -[Kotlin Download Kotlin UI Kit Library](https://github.com/cometchat/cometchat-uikit-android/tree/v3) - -* Import `uikit-kotlin` Module from Module Settings -* If the Library is added successfully, it will look like mentioned in the below image. - - - - - -### **Configure Kotlin UI Kit Library** - -To use UI Kit you have to add Material Design support in your app as the UI Kit uses Material Design Components. - -* Add Material Design Dependency in build.gradle - - - -```gradle -dependencies { - implementation 'com.google.android.material:material:' -} -``` - - - - - -* Make sure that your app's theme should extend `Theme.MaterialComponents`. Follow the guide on [Getting started Material Components](https://material.io/develop/android/docs/getting-started/) - -The following is the list of Material Components themes you can use to get the latest component styles and theme-level attributes. - -* `Theme.MaterialComponents.NoActionBar` -* Theme.MaterialComponents.Light.NoActionBar -* Theme.MaterialComponents.DayNight.NoActionBar - -Update your app theme to inherit from one of these themes, e.g.: - - - -```xml - -``` - - - - - - -Enable DataBinding - -As the UI Kit uses DataBinding you must enable DataBinding - - - -To configure your app to use data binding, add the dataBinding element to your `build.gradle` file in the app module, as shown in the following example: - - - -```gradle -android { - dataBinding { - enabled = true - } -} -``` - - - - - - -important - -We are using File Provider for storage & file access. So you need to add your application package name in manifestPlaceholders - - - - - -```gradle -android { - defaultConfig { - ... - - manifestPlaceholders = [file_provider: "YOUR_PACKAGE_NAME"] - //add your application package. - } - } -``` - - - - - -### **Launch CometChatUI** 🚀 - - - - - -**CometChatUI** is an option to launch a fully functional chat application using the UI Kit. In UI Kit all the UI Components are interlinked and work together to launch a fully functional chat on your mobile/application. - -To use CometChatUI user has to launch CometChatUI Activity. Add the following code snippet to launch `CometChatUI`. - - - -```kotlin -startActivity(Intent(this@YourActivity, CometChatUI::class.java)) -``` - - - - - -## **See our Kotlin chat sample app** - -Visit our [Kotlin chat app](https://github.com/cometchat-pro/android-kotlin-chat-app) repository to run a sample app and see the UI Kit in action. diff --git a/ui-kit/kotlin/ui-components.mdx b/ui-kit/kotlin/ui-components.mdx deleted file mode 100644 index 09d47a44a..000000000 --- a/ui-kit/kotlin/ui-components.mdx +++ /dev/null @@ -1,1028 +0,0 @@ ---- -title: "UI Components" -description: "UI Components — CometChat documentation." ---- - -**UI Components** are building a block of the UI Kit. **UI Components** are a set of custom classes specially designed to build a feature-rich chat app. To achieve high customizability while building an app one can use the UI Components. There are different UI Components available in the UI Kit library. - -## **1. CometChatUI** - -**CometChatUI** is an option to launch a fully functional chat application using the UI Kit. In **CometChatUI** all the UI Components are interlinked and work together to launch a fully functional chat on your mobile application. - - - - - -CometChatUI is an Activity class, so you can launch `CometChatUI` using the below code snippet Make sure to add the following code snippet after `onSuccess` of CometChat login. - - - -```kotlin -android { - defaultConfig { - ... - - manifestPlaceholders = [file_provider: "YOUR_PACKAGE_NAME"] - //add your application package. - } - } -``` - - - - - - - -Make sure that the above code snippet is added after `onSuccess` of CometChat login - - - -## **2. CometChatConversationList** - -The **CometChatConversationList** is Fragment which will help you to display a list of recent conversations. The Fragment has all the necessary listeners and methods required to display the list of conversations. - -### **Usage** - -In your layout file (.xml file) add the following snippet to use the `CometChatConversationList`. Adding the following code snippet will give you a fully working list of conversations. - - - -```xml - -``` - - - - - - - - - -### **Note About `setItemClickListener` on CometChatConversationList** - -To get the click event of the list you must use `setItemClickListener`. The `setItemClickListener` has `OnItemClick()` to handle single click and `OnItemLongClick()` to handle long click events. - - - -```kotlin -cometChatConversationList.setItemClickListener(object : OnItemClickListener - - - -## **3. CometChatUserList** - -The `CometChatUserList` is a fragment with a List of users. The Fragment has all the necessary listeners and methods required to display the user's list. - -### **Usage** - -In your layout file (.xml file) add the following snippet to use the `CometChatUserList`. Adding the following code snippet will give you a fully working list of users. - - - -```xml - -``` - - - - - - - - - -### **Note About `setItemClickListener` on CometChatUserList** - -To get the click event of the list you must use `setItemClickListener`. The `setItemClickListener` has `OnItemClick()` to handle single click and `OnItemLongClick()` to handle long click events. - - - -```kotlin -cometChatUserList.setItemClickListener(object : OnItemClickListener() { - - override fun OnItemClick(t: Any, position: Int) { - - } - override fun OnItemLongClick(t: Any, position: Int) { - super.OnItemLongClick(t, position) - } - }) -``` - - - - - -## **4. CometChatGroupList** - -The `CometChatGroupList` is a fragment with a List of groups Fragment has all the necessary listeners and methods required to display the list of groups - -### **Usage** - -In your `layout.xml` add the following snippet to use the `CometChatGroupList`.Adding the following code snippet will give you a full working list of groups. - - - -```xml - -``` - - - - - - - - - -### **Note About `setItemClickListener` on CometChatGroupList** - -To get the click event of the list you must use `setItemClickListener`. The `setItemClickListener` has `OnItemClick()` to handle single click and `OnItemLongClick()` to handle long click events. - - - -```kotlin -cometChatGroupList.setItemClickListener(object : OnItemClickListener() { - - override fun OnItemClick(t: Any, position: Int) { - - } - override fun OnItemLongClick(t: Any, position: Int) { - super.OnItemLongClick(t, position) - } -}) -``` - - - - - -## **5. CometChatMessageList** - -`CometChatMessageList` is a fragment that consists of send and received messages. It is capable of sending and receiving different types of messages such as text, image, and documents. - -### **Usage** - -To use `CometChatMessageList` follow the below code snippets. `CometChatMessageList` is a dynamic so it will require some arguments. Add a `FrameLayout` in your `layout.xml` - - - -```xml - -``` - - - - - - - - - -In your activity set the required parameter in the following manner. - - - -```kotlin -val bundle = Bundle() -bundle.putString(UIKitContracts.IntentStrings.AVATAR, "AvatarUrl") -bundle.putString(UIKitContracts.IntentStrings.NAME,"Name") -bundle.putString(UIKitContracts.IntentStrings.TYPE,CometChatConstants.RECEIVER_TYPE_USER) -bundle.putString(UIKitContracts.IntentStrings.UID,"UID") -bundle.putString(UIKitContracts.IntentStrings.STATUS,"STATUS") -fragment.arguments = bundle -supportFragmentManager.beginTransaction().replace(R.id.ChatFragment, fragment).commit() -``` - - - - - -## **6 CometChatCallList** - -You can use the CometChatCallList to get a list of all the calls made by the logged-in user to other users and groups. - -### **Usage** - -Add the following code in your layout file (.xml file) - - - -```xml - -``` - - - - - - - - - -## **7. CometChatUserProfile** - -`CometChatUserProfile` is a fragment which provides detail about the currently logged-in user in the CometChat. - -### **Usage** - -Add the following code in your layout file (.xml file) - - - -```xml - -``` - - - - - - - - - -## **8. Shared** - -There are certain core components that are being used everywhere in `uiKit` library. You will find those components in `shared` folder under `ui_components`. Below are core components that are being used in `uiKit` library. - -### **8.1. CometChatAvatar** - -This is an image view customize only to display Avatar. This view can be used with image URLs as well as with CometChat objects like `User` and `Group` - - - - - -### **Usage** - -In your `layout.xml` add the following code snippet. - - - -```xml - -``` - - - - - -Here `avatar_shape` is a static property. It should be either `circle` or `rectangle`. whereas the avatar URL needs to be set dynamically following is the sample code for the same. - - - -```kotlin -val avatar: CometChatAvatar = findViewById(R.id.av_user) -userViewHolder.avatar.setAvatarUrl("https://randomuser.me/api/portraits/women/44.jpg") -``` - - - - - -The CometChatAvatar Component works well with CometChat `User` and `Group` object. The `setAvatar()` method accepts `User` or `Group` object if Avatar of `User` or `Group` is not available it automatically show the initials of the user or group name as a placeholder Avatar. - - - - - - - - - - - - - -### **Common Features** - -CometChat Avatar class provides functionality for an Avatar feature. There are commonly used properties to control the look of the Avatar. - -| CometChatAvatar field element | Relevant attributes/methods | -| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| Avatar Shape | app:avatar\_shape | -| Avatar | app:avatar`# setAvatar(@NonNull User)`# setAvatar(@NonNull Group)`# setAvatar(@NonNull String)`# setAvatar(@NonNull Drawable, @NonNull String) | -| Avatar Initial | app:avatar\_initials\`\`# setInitials(@NonNull String) | -| Border Color | app:border\_color | -| Border Width | app:border\_width | - -### **8.2. CometChatUserPresence** - -This view will be used to show the user status if the user is online or offline. This view will take user status and display the color accordingly. - - - - - -### **Usage** - -In your `layout.xml` add the following code - - - -```xml - -``` - - - - - -User status can be set dynamically using the following code. - - - -```kotlin -val userPresence: CometChatUserPresence = findViewById(R.id.statusIndicator) -userViewHolder.statusIndicator.setUserStatus(user.status) -``` - - - - - -### **Common Features** - -CometChatUserPresence provides `app:user_status` attribute and method `setUserStatus` to set Status of the user. - -The `app:user_status` attribute can also be used with DataBinding in the following manner - -e.g `app:user_status="@{user.status}"` you can also use different objects according to their use case. The attribute will continue to work as long as receives a string parameter - -| CometChatUserPresence field element | Relevant attributes/methods | -| ----------------------------------- | --------------------------------------------------- | -| User Status | `app:user_status``# setUserStatus(@NonNull String)` | - -### **8.3. CometChatBadgeCount** - -The CometChatBadgeCount component can be used to show an unread count. You can use it in different scenarios according to their use case. - - - - - -Add the following code to your `layout.xml` - - - -```xml - -``` - - - - - -The count can be set dynamically using the `setCount` method. The `setCount` method takes an int as a parameter. - - - -```kotlin -val badgeCount: CometChatBadgeCount = findViewById(R.id.badgecount) -holder.badgeCount.messageCount.setCount(conversation.unreadMessageCount) -``` - - - - - -### **Common Feature** - -The CometChatBadgeCount component provides different attributes and methods to control the behavior and appearance of the BadgeCount view. - -The attribute `app: count` can also be used with DataBinding - - - -```xml -/// example with conversation object - - -``` - - - - - -| CometChatBadgeCount field element | Relevant attributes/methods | -| --------------------------------- | ------------------------------------------------------------------- | -| Count | `app:count``# setCount(int)` | -| Count Size | `app:count_size``# setCountSize(float)` | -| Count Background Color | `app:count_background_color``# setCountBackground(@ColorRes color)` | -| Count Color | `app:count_color``setCountSize(float)` | - -### **8.4. CometChatUsers** - -The `CometChatUsers` is custom **RecyclerView** which helps to display a list of users present in your CometChat app. - - - - - -### **Note about `CometChatUsers` using with DataBinding:** - -Your project should have DataBinding enabled. You can use `CometChatUsers` using DataBinding in the following manner - -In your `layout.xml` add the following code : - - - -```xml - - - - - - - - - - -``` - - - - - -In your corresponding activity or fragment add the following code - -```kotlin -val userList: ObservableArrayList = ObservableArrayList() -binding.setUserList(userList) -``` - -For getting the list of users you can use `UsersRequestBuilder()`. Visit the below link for more details on how to retrieve a list of users. - -In `onSuccess` of the `fetchNext` method you can set the data the `ObservableArrayList` you have created. The advantage of using the `ObservableArrayList` is one doesn't have to manually set the data on `binding.setUserList(userList);` every time you get a new set of data. - - - -```kotlin -usersRequest.fetchNext(object : CallbackListener>() { - public override fun onSuccess(list: List) { - Log.d(TAG, "User list received: " + list.size) - userList.addAll(list) - //update the ObservableArrayList here - } - - public override fun onError(e: CometChatException) { - Log.d(TAG, "User list fetching failed with exception: " + e.message) - } -}) -``` - - - - - -### **Note About `CometChatUsers` Without DataBinding** - -If you are not using DataBinding in your project you can use the `CometChatUser` in the following manner. - -In your `layout.xml` add the following code - - - -```xml - -``` - - - - - -In your corresponding activity or fragment. - - - -```kotlin -var cometChatUsers: CometChatUsers = findViewById(R.id.cometchatUsers); -cometChatUser.setUserList(list); -// list: fetched using the UsersRequestBuilder -``` - - - - - -To get the list of users you can use UsersRequestBuilder(). Visit the link below for more details on [Retrieve Users](/sdk/android/retrieve-users) - -### **Note About Using `setItemClickListener`** - -For getting the click event of `CometChatUsers` you can make use of `setItemClickListener` class. - - - -```kotlin -cometChatUsers.setItemClickListener(object : OnItemClickListener() { - - override fun OnItemClick(t: Any, position: Int) { - - } - override fun OnItemLongClick(t: Any, position: Int) { - super.OnItemLongClick(t, position) - } -}) -``` - - - - - -### **Common Usage** - -The `CometChatUser` component provides different properties to control the behavior of `CometChatUser` view. - -| CometChatUser field elements | Relevant attributes/methods | -| ---------------------------- | --------------------------- | -| Update List | `# setUserList(List)` | -| Update | `# update (User)` | -| Remove | `# remove(String)` | -| Add | `# add(User)` | - -### **8.5. CometChatGroups** - -The `CometChatGroups` is a custom **RecyclerView** that helps you to display a list of groups. - - - - - -### **Note About `CometChatGroups` Using With DataBinding** - -If you are using DataBinding in your project you can use the `CometChatGroups` in the following manner. - -In your `layout.xml` add the following code snippet - - - -```java - - - - - - - - - - -``` - - - - - -In your corresponding activity or fragment . - - - -```kotlin -val groupList: ObservableArrayList = ObservableArrayList() -binding.setGroupList(groupList) -``` - - - - - -For getting the list of groups you can use `GroupsRequestBuilder()`.Visit the below link for more details on how to retrieve a list of group. - -In `onSuccess` of the `fetchNext` method you can set the data the `ObservableArrayList` you have created. The advantage of using the `ObservableArrayList` is one doesn't have to manually set the data on `binding.setGroupList(groupList);` every time you get a new set of data. - - - -```kotlin -groupsRequest.fetchNext(object : CallbackListener>() { - public override fun onSuccess(list: List) { - Log.d(TAG, "Groups list fetched successfully: " + list.size); - groupList.addAll(list) - // update the ObservableArrayList here - } - - public override fun onError(e: CometChatException) { - Log.d(TAG, "Groups list fetching failed with exception: " + e.message); - } -}) -``` - - - - - -### **Note About `CometChatGroups` Without DataBinding** - -If you are not using DataBinding in your project you can use the `CometChatGroups` in the following manner. - -In your `layout.xml` add the following code - - - -```xml - -``` - - - - - -In your corresponding activity or fragment - - - -```kotlin -val cometChatGroups: CometChatGroups = findViewById(R.id.cometchatGroupList) -cometChatGroups.setGroupList(list) -// list: fetched using the GroupsRequestBuilder -``` - - - - - -You can refer to how to [Retrieve Groups](/sdk/android/retrieve-groups). - -### **Note About Using `setItemClickListener`** - -For getting the click event of `CometChatGroups` you can make use of `setItemClickListener` class. - - - -```kotlin -cometChatGroups.setItemClickListener(object : OnItemClickListener() { - - override fun OnItemClick(t: Any, position: Int) { - - } - override fun OnItemLongClick(t: Any, position: Int) { - super.OnItemLongClick(t, position) - } -}) -``` - - - - - -### **Common Usage** - -The `CometChatGroups` component provides different properties to control the behavior of `CometChatGroups` view. You can perform different operations like an update, remove, add, etc. - -| CometChatGroups field elements | Relevant attributes/methods | -| ------------------------------ | ----------------------------- | -| Update List | `# setGroupList(List)` | -| Update | `# update (Group)` | -| Remove | `# remove(String)` | -| Add | `# add(Group)` | - -### **8.6.CometChatConversations** - -`CometChatConversations` is a custom **RecyclerView** which will help you to display a list of all the users and groups in which the logged-in user has made any conversation. - - - - - -### **Note about `CometChatConversations` using with DataBinding** - -If you are using DataBinding in your project you can use the `CometChatConversations` in the following manner. - -In your `layout.xml` add the following code. - - - -```xml - - - - - - - - - - - -``` - - - - - -In your corresponding activity or fragment. - - - -```kotlin -val conversationList: ObservableArrayList = ObservableArrayList() -binding.setConversationList(conversationList) -``` - - - - - -For getting the list of conversation you can use `ConversationsRequestBuilder()` .visit the below link for more details on how to retrieve a list of conversation - -In `onSuccess` of the `fetchNext` method you can set the data the `ObservableArrayList` you have created. The advantage of using the `ObservableArrayList` is one doesn't have to manually set the data on `binding.setConversationList(conversationList);` every time you get a new set of data. - - - -```kotlin -conversationsRequest.fetchNext(object : CallbackListener>() { - override fun onSuccess(conversations: List) { - // Handle list of conversations - conversationList.addAll(conversations) - // update ObservableArrayList list here - } - - override fun onError(e: CometChatException) { - // Handle failure - Log.d(TAG, "onError: " + e.message) - } -}) -``` - - - - - -### **Note About `CometChatConversations` Without DataBinding** - -If you are not using DataBinding in your project you can use the `CometChatConversations` in the following manner. - -In your `layout.xml` add the following code - - - -```xml - -``` - - - - - -In your corresponding activity or fragment - - - -```kotlin -val cometChatConversations: CometChatConversations = findViewById(R.id.cometchatConversations); - -cometChatConversationList.setConversationList(conversations); -// list: fetched using the ConversationsRequestBuilder -``` - - - - - -In `onSuccess` of the `fetchNext` method of `ConversationsRequestBuilder`, you can set the data. You can refer how to [Retrieve Conversations](/sdk/android/retrieve-conversations) - -### **Note About Using `setItemClickListener`** - -For getting the click event of `CometChatConversations` you can make use of the `ConversationItemClickListener` class. - - - -```kotlin -cometChatConversations.setItemClickListener(object : OnItemClickListener() { - - override fun OnItemClick(t: Any, position: Int) { - - } - override fun OnItemLongClick(t: Any, position: Int) { - super.OnItemLongClick(t, position) - } -}) -``` - - - - - -### **Common Usage** - -The `CometChatConversations` component provides different properties to control the behavior of the `CometChatConversations` view. You can perform different operations like an update, remove, add, etc - -| CometChatConversations field elements | Relevant attributes/methods | -| ------------------------------------- | ------------------------------------------- | -| Update List | `# setConversationList(List)` | -| Update | `# update (Conversation)` | -| Remove | `# remove(Conversation)` | -| Add | `# add(Conversation)` | - -### **8.7. CometChatCalls** - -`CometChatCalls` is custom **RecyclerView** which will help you to display list of calls. - - - - - -You can use the `CometChatCalls` in the following manner. - -In your `layout.xml` add the following code : - - - -```xml - -``` - - - - - -In your corresponding activity or fragment - - - -```kotlin -val cometChatCalls: CometChatCalls = findViewById(R.id.cometchatCalls); -``` - - - - - -In `onSuccess` of the `fetchNext` method of `MessagesRequestBuilder` you can set the data. You need to add `setCategory(CometChatConstants.CATEGORY_CALL)` in your `MessagesRequestBuilder` to fetch only call messages - -You can refer an **example here.** - - - -```kotlin -if (messagesRequest == null) -{ - messagesRequest = MessagesRequestBuilder().setCategory(CometChatConstants.CATEGORY_CALL).setLimit(30).build() -} -messagesRequest.fetchPrevious(object : CallbackListener>() { - override fun onSuccess(baseMessages: List) { - /*Since the call list received like messages i.e top with older and - bottom with the latest message. We will reverse the list */ - Collections.reverse(baseMessages) - cometCallList.setCallList(baseMessages) - } - - override fun onError(e: CometChatException) { - //Error Message - Log.e("onError: ", e.message) - } -}) -``` - - - - - -### **Note About Using `CallItemClickListener`:** - -For getting the click event of `CometChatCalls` you can make use of `ItemClickListener` class. - -There are two events given by `CometChatCalls`. - -This event is performed when clicking on the User or Group item displayed in the call list. - - - -```kotlin -cometChatCalls.setItemClickListener(object : OnItemClickListener() { - override fun OnItemClick(t: Any, position: Int) { - // perform your action here - } -}) -``` - - - - - -This event is performed when click on call icon visible after each Group or User item in call list. - - - -```kotlin -cometChatCalls.setItemCallClickListener(object : OnItemClickListener() { - override fun OnItemClick(t: Any, position: Int) { - // perform your action here - } -}) -``` - - - - - -### **Common Usage:** - -The `CometChatCalls` component provides different properties to control the behavior of the `CometChatCalls` view. You can perform different operations like an update, remove. - -| CometChatCalls field e | Relevant attributes/methods | -| ---------------------- | --------------------------- | -| Update List | setCallList(List) | -| Update | update (Call) | -| Remove | remove(Call) |