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.
- 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.
- Clone this repository.
- Install the dependencies:
npm i
- Paste the
firebaseConfig
in the correct location as per FCM's documentation. - Add your app credentials like
appId
,region
,authKey
in thesrc/const.ts
. - Also add the
fcmProviderId
insrc/const.ts
as that is required while registering push token. - Add
vapidKey
obtained 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.
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.