Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

CometChat

React Native Sample App with Push Notifications by CometChat

This is a reference application showcasing the integration of CometChat's React Native UI Kit in a React Native project. It demonstrates how to implement real-time messaging and voice/video calling features with ease.

Prerequisites

Sign up for a CometChat account to obtain your app credentials: App ID, Region, and Auth Key

  • Node.js 18 or higher
  • React Native Version 0.77 or later (up to the latest version)

iOS

  • XCode
  • Pod (CocoaPods) for iOS
  • An iOS device or emulator with iOS 12.0 or above.
  • Ensure that you have configured the provisioning profile in Xcode to run the app on a physical device.

Android

  • Android Studio
  • Android device or emulator with Android version 5.0 or above.

Installation

  1. Clone the repository:

    git clone https://github.com/cometchat/cometchat-uikit-react-native.git
  2. Change into the specific app's directory (e.g., SampleAppWithPushNotifications).

      cd examples/SampleAppWithPushNotifications
  3. Run npm install to install the dependencies.

  4. [Optional] Configure CometChat credentials:

    • Open the AppConstants.tsx file located at examples/SampleApp/src/utils/AppConstants.tsx and enter your CometChat appId, region, and authKey:
      export const AppConstants = {
          appId: 'YOUR_APP_ID',
          authKey: 'YOUR_AUTH_KEY',
          region: 'REGION',
          //other properties
      }
  5. Push Notification Setup guide

    • APNs

    • FCM

      • Go to the Firebase Console and create a project.
      • Add your Android app to the Firebase project and download the google-services.json file.
      • Place the google-services.json file in the SampleAppWithPushNotification/android/app directory of your project.
    • CometChat Push Notification

  6. Update the fcmProviderId & apnProviderId from the step 6 in

    export const AppConstants = {
       fcmProviderId: '',
       apnProviderId: '',
    }
  7. For iOS, install dependencies after navigating to ios:

     cd ios
     pod install
  8. Run the app on a device or emulator from the repo root.

     npm start
     npm run android
     npm run ios

Help and Support

For issues running the project or integrating with our UI Kits, consult our documentation or create a support ticket. You can also access real-time support via the CometChat Dashboard.