Skip to content

kaushikRitik/cometchat-push-notification-app-react-native

 
 

Repository files navigation

CometChat

React Native Enhanced Push Notifications (Beta) Sample App

The CometChat React Native Enhanced Push Notifications (Beta) Sample App is capable of handling push notifications for one-on-one (private), group messaging, and even call notifications. This sample app enables users to send and receive text messages, make and receive calls, and effectively displays push notifications for these interactions.

In our sample app:

  • Firebase Cloud Messaging (FCM) is used for displaying push notifications in Android
  • Apple Push Notification (APN) is used for displaying push notifications in iOS.

Note

If you are using Push Notifications (Extension), please refer to our React Native Push Notifications (Extension) Sample app.

Pre-requisite

  1. Login to the CometChat Dashboard.
  2. Select an existing app or create a new one.
  3. Click on the Notifications section from the menu on the left.
  4. Enable Push Notifications by clicking on the toggle bar and configure the push notifications.
  5. Add credentials for FCM or APNs.

Run the Sample App

  1. Clone this repository.
  2. Run the following commands:
npm i -f
cd ios
pod install
cd ..
  1. If you're using Firebase Cloud Messaging (FCM), place the google-services.json & GoogleService-Info.plist files in the correct location as per FCM's documentation.
  2. Add your app credentials like APP_ID, REGION, and AUTH_KEY in the src/CONSTS.ts file.
  3. Also enter the correct Provider IDs that will be used to register the push tokens.
  4. Run the sample app
npm run android # To run the Android app
npm run ios # To run the iOS app
  1. Once the app is running on your device or emulator, login with a user.(The iOS app has to be run on a device. The Android app can run on emulator or device.)
  2. Allow the permission to display push notifications.
  3. Put the app in the background or terminate it.
  4. Send a message or call to the logged in user from another device.
  5. You should see a push notification for a message and call notification for a call.
  6. Tap on the notification to open the Sample app for message.
  7. Tap on accept/decline on call notification to initiate or decline call.

Help and Support

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

About

Push Notification App for React Native (iOS/Android)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 65.2%
  • Java 12.1%
  • Objective-C++ 7.8%
  • JavaScript 7.1%
  • Objective-C 3.9%
  • Ruby 3.9%