CometChat React Native UI Kit
repository·v5·Indexed 21 days ago
https://github.com/cometchat/cometchat-uikit-react-nativeA 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.
What's inside cometchat-uikit-react-native
- CometChat React Native UIKit is a pre-built user interface kit designed to help developers quickly integrate a fully-featured chat experience into existing or new mobile applications. It provides ready-to-use UI components to handle messaging workflows.
Getting Started with CometChat UI Kit
v5To integrate the UI Kit into your project, follow these steps:
- Register: Create an account at the CometChat Dashboard.
- Create an App: Log in to the dashboard and create a new application.
- Retrieve Credentials: Obtain your
App IDandAuth Keyfrom the dashboard. These are required for initialization. - Learn Fundamentals: Review CometChat's Key Concepts to understand the underlying architecture.
- Integrate: Follow the official Integration Steps to add the UI Kit to your iOS or Android application.
Set up the React Native Sample App
v5The 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, andAuth Keyfrom 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.
- CometChat Account: You need an
Prerequisites for SampleAppExpo
v5Before running the sample app, ensure your environment meets the following requirements:
CometChat Requirements:
- A CometChat account with an
App ID,Region, andAuth 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.
- A CometChat account with an
Set up the React Native Sample App Expo
v5This 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:iosPrerequisites for CometChat React Native UI Kit
v5Before 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
Configure CometChat credentials in SampleAppExpo
v5To connect the sample app to your CometChat instance, you must provide your application credentials in the
AppConstants.tsxfile.- Locate the file at
examples/SampleAppExpo/src/utils/AppConstants.tsx. - Update the
AppConstantsobject with yourappId,authKey, andregionobtained from the CometChat Dashboard.
export const AppConstants = { appId: 'YOUR_APP_ID', authKey: 'YOUR_AUTH_KEY', region: 'REGION', //other properties }- Locate the file at
Set up the React Native AI Agents Sample App
v5This 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, andAuth Keyfrom 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
- Clone the repository:
git clone https://github.com/cometchat/cometchat-uikit-react-native.git - Navigate to the AI sample directory:
cd examples/SampleAppAI - Install dependencies:
npm install - Configure Credentials: Open
examples/SampleApp/src/utils/AppConstants.tsx(note the path relative to the project structure) and update theAppConstantsobject with your credentials. - iOS Setup: If running on iOS, install pods:
cd ios pod install - 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- CometChat Account: You need an
Configure Push Notifications (FCM and APNs)
v5To enable push notifications in the sample app, follow these platform-specific steps:
Android (FCM)
- Create a project in the Firebase Console.
- Add your Android app to the Firebase project.
- Download the
google-services.jsonfile. - Place
google-services.jsonin theSampleAppWithPushNotification/android/appdirectory.
iOS (APNs)
- Follow the APNs integration guide to add credentials.
Finalizing Provider IDs
After completing the platform setup, you must update the
fcmProviderIdandapnProviderIdin theAppConstantsobject within your project code to link the CometChat notification service with your providers.export const AppConstants = { fcmProviderId: '', apnProviderId: '', }Install and run the Sample App
v5Follow these steps to clone, configure, and run the Sample App locally.
- Clone the repository:
git clone https://github.com/cometchat/cometchat-uikit-react-native.git - Navigate to the app directory:
cd examples/SampleApp - Install dependencies:
npm install - Configure CometChat credentials (See 'Configure CometChat credentials' for details).
- Install iOS pods (iOS only):
cd ios pod install - 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- Clone the repository:
Report a security vulnerability to CometChat
v5If 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.comSet up the React Native Sample App with Push Notifications
v5This 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, andAuth Keyfrom 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
- Clone the repository:
git clone https://github.com/cometchat/cometchat-uikit-react-native.git - Navigate to the specific app directory:
cd examples/SampleAppWithPushNotifications - Install dependencies:
npm install - For iOS, install CocoaPods:
cd ios && pod install - 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- CometChat Account: You need an