CometChat React Native UI Kit

repository·v5·Indexed 21 days ago

https://github.com/cometchat/cometchat-uikit-react-native

A set of pre-built UI components for rapidly implementing chat, real-time messaging, and voice/video calling in React Native mobile applications. The kit includes support for AI-powered chat agents, push notifications (FCM and APNs), and Expo development builds. Requires Node.js 18+, React Native 0.77+, and compatible iOS (12.0+) or Android (5.0+) environments.

Tokens
42.6K
Snippets
208
Records
325
Agent score
73%

What's inside cometchat-uikit-react-native

  1. Getting Started with CometChat UI Kit

    v5

    To integrate the UI Kit into your project, follow these steps:

    1. Register: Create an account at the CometChat Dashboard.
    2. Create an App: Log in to the dashboard and create a new application.
    3. Retrieve Credentials: Obtain your App ID and Auth Key from the dashboard. These are required for initialization.
    4. Learn Fundamentals: Review CometChat's Key Concepts to understand the underlying architecture.
    5. Integrate: Follow the official Integration Steps to add the UI Kit to your iOS or Android application.
  2. Set up the React Native Sample App

    v5

    The Sample App is a reference implementation demonstrating how to integrate the CometChat React Native UI Kit for real-time messaging and voice/video calling.

    Prerequisites

    • CometChat Account: You need an App ID, Region, and Auth Key from the CometChat Dashboard.
    • Node.js: Version 18 or higher.
    • React Native: Version 0.77 or later.

    iOS Requirements

    • Xcode and CocoaPods installed.
    • iOS device or emulator running iOS 12.0 or above.
    • Configured provisioning profile in Xcode for physical devices.

    Android Requirements

    • Android Studio installed.
    • Android device or emulator running Android 5.0 or above.
  3. Prerequisites for SampleAppExpo

    v5

    Before running the sample app, ensure your environment meets the following requirements:

    CometChat Requirements:

    • A CometChat account with an App ID, Region, and Auth Key.

    Development Environment:

    • Node.js: version 18 or higher.
    • React Native: version 0.77 or later.

    iOS Requirements:

    • Xcode and CocoaPods installed.
    • An iOS device or emulator running iOS 12.0 or above.
    • A configured provisioning profile in Xcode for physical device testing.

    Android Requirements:

    • Android Studio installed.
    • An Android device or emulator running Android 5.0 or above.
  4. Set up the React Native Sample App Expo

    v5

    This sample application demonstrates how to integrate the CometChat React Native UI Kit into an Expo project to implement real-time messaging and voice/video calling.

    Important Compatibility Note: The React Native UI Kit is not compatible with Expo Go because it requires custom native modules. You must use Development Builds (custom dev clients) to run the UI Kit within an Expo environment.

    # 1. Clone the repository
    git clone https://github.com/cometchat/cometchat-uikit-react-native.git
    
    # 2. Navigate to the Expo sample app directory
    cd examples/SampleAppExpo
    
    # 3. Install dependencies
    npm install
    
    # 4. Generate native Android and iOS project folders (required for custom dev client)
    npx expo prebuild
    
    # 5. Run the app
    npx expo run:android
    npx expo run:ios
  5. Prerequisites for CometChat React Native UI Kit

    v5

    Before integrating the UI Kit, ensure your development environment meets the following requirements:

    General

    • Node.js: version 18 or higher
    • React Native: version 0.77 or later

    iOS Development

    • Xcode
    • CocoaPods
    • iOS device or emulator running iOS 12.0 or above

    Android Development

    • Android Studio
    • Android device or emulator running Android 5.0 or above
  6. Configure CometChat credentials in SampleAppExpo

    v5

    To connect the sample app to your CometChat instance, you must provide your application credentials in the AppConstants.tsx file.

    1. Locate the file at examples/SampleAppExpo/src/utils/AppConstants.tsx.
    2. Update the AppConstants object with your appId, authKey, and region obtained from the CometChat Dashboard.
    export const AppConstants = {
        appId: 'YOUR_APP_ID',
        authKey: 'YOUR_AUTH_KEY',
        region: 'REGION',
        //other properties
    }
  7. Set up the React Native AI Agents Sample App

    v5

    This sample application demonstrates how to integrate the CometChat React Native UI Kit to build AI-powered chat agents. Follow these steps to set up the environment and run the demo.

    Prerequisites

    • CometChat Account: You need an App ID, Region, and Auth Key from the CometChat Dashboard.
    • Node.js: Version 18 or higher.
    • React Native: Version 0.77 or later.
    • iOS Requirements: Xcode, CocoaPods, and an iOS device/emulator (iOS 12.0+).
    • Android Requirements: Android Studio and an Android device/emulator (Android 5.0+).

    Installation Steps

    1. Clone the repository:
      git clone https://github.com/cometchat/cometchat-uikit-react-native.git
    2. Navigate to the AI sample directory:
      cd examples/SampleAppAI
    3. Install dependencies:
      npm install
    4. Configure Credentials: Open examples/SampleApp/src/utils/AppConstants.tsx (note the path relative to the project structure) and update the AppConstants object with your credentials.
    5. iOS Setup: If running on iOS, install pods:
      cd ios
      pod install
    6. Run the App:
      npm start
      npm run android
      # OR
      npm run ios
    git clone https://github.com/cometchat/cometchat-uikit-react-native.git
    cd examples/SampleAppAI
    npm install
    # For iOS
    cd ios && pod install
    # Run
    npm run ios
  8. Configure Push Notifications (FCM and APNs)

    v5

    To enable push notifications in the sample app, follow these platform-specific steps:

    Android (FCM)

    1. Create a project in the Firebase Console.
    2. Add your Android app to the Firebase project.
    3. Download the google-services.json file.
    4. Place google-services.json in the SampleAppWithPushNotification/android/app directory.

    iOS (APNs)

    1. Follow the APNs integration guide to add credentials.

    Finalizing Provider IDs

    After completing the platform setup, you must update the fcmProviderId and apnProviderId in the AppConstants object within your project code to link the CometChat notification service with your providers.

    export const AppConstants = {
       fcmProviderId: '',
       apnProviderId: '',
    }
  9. Install and run the Sample App

    v5

    Follow these steps to clone, configure, and run the Sample App locally.

    1. Clone the repository:
      git clone https://github.com/cometchat/cometchat-uikit-react-native.git
    2. Navigate to the app directory:
      cd examples/SampleApp
    3. Install dependencies:
      npm install
    4. Configure CometChat credentials (See 'Configure CometChat credentials' for details).
    5. Install iOS pods (iOS only):
      cd ios
      pod install
    6. Run the application:
      npm start
      # In separate terminals:
      npm run android
      npm run ios
    git clone https://github.com/cometchat/cometchat-uikit-react-native.git
    cd examples/SampleApp
    npm install
    # For iOS
    cd ios && pod install
    # Run
    cd ..
    npm start
    npm run android
    npm run ios
  10. Report a security vulnerability to CometChat

    v5

    If you discover a security vulnerability in CometChat Pro, please follow the Responsible Disclosure Policy. To ensure the safety of the community, keep potential vulnerabilities confidential until they are confirmed and fixed.

    To report a security-related issue, contact the CometChat Pro security team directly via email.

    security@cometchat.com
  11. Set up the React Native Sample App with Push Notifications

    v5

    This guide outlines how to set up the reference application for demonstrating CometChat's React Native UI Kit with real-time messaging and voice/video calling, including push notification integration.

    Prerequisites

    • CometChat Account: You need an App ID, Region, and Auth Key from the CometChat Dashboard.
    • Node.js: Version 18 or higher.
    • React Native: Version 0.77 or later.
    • iOS Requirements: Xcode, CocoaPods, and an iOS device/emulator (iOS 12.0+). Ensure provisioning profiles are configured for physical devices.
    • Android Requirements: Android Studio and an Android device/emulator (Android 5.0+).

    Installation Steps

    1. Clone the repository:
      git clone https://github.com/cometchat/cometchat-uikit-react-native.git
    2. Navigate to the specific app directory:
      cd examples/SampleAppWithPushNotifications
    3. Install dependencies:
      npm install
    4. For iOS, install CocoaPods:
      cd ios && pod install
    5. Run the application:
      npm start
      npm run android
      # OR
      npm run ios
    git clone https://github.com/cometchat/cometchat-uikit-react-native.git
    cd examples/SampleAppWithPushNotifications
    npm install
    cd ios && pod install
    npm start
    npm run android