React Enhanced Push notifications (Beta) Sample app
The CometChat React Enhanced Push notifications (Beta) Sample app is a fully functional push notification app capable of one-on-one (private) and group messaging, and Calling. This sample app enables users to send and receive push notifications for text and multimedia messages like images, videos, documents and Custom Messages.
[!NOTE] If you are using Push Notifications (Extension), please refer to our React Push Notifications (Extension) Sample app for guidance.
Pre-requisite
- Login to the CometChat Dashboard.
- Select an existing app or create a new one.
- Click on the Notifications section from the menu on the left.
- Enable Push Notifications by clicking on the toggle bar and configure the push notifications.
- Add credentials for FCM and make a note of the provider id.
Run the Sample App
- Clone this repository.
- Install the dependencies:
npm i
-
Paste the
firebaseConfigin the correct location as per FCM's documentation. -
Add your app credentials like
appId,region,authKeyin thesrc/const.ts. -
Also add the
fcmProviderIdinsrc/const.tsas that is required while registering push token. -
Add
vapidKeyobtained from the Firebase console -> Cloud Messaging -> Web Push Certificates to thefirebase.js. -
Run the sample app.
npm start -
Once the app opens up in a browser, login with a user.
-
Allow the permission to display push notifications.
-
Send a message or call to the logged in user from another browser/device.
-
You should see a push notification for a message.
-
Tap on the notification to open the Sample app for message.
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.