The CometChat Flutter Push Notification 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.
- 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 or APNs.
- Clone this repository.
- To configure using FCM or APN, use the
v4
branch. - Execute the following command in the terminal:
flutterfire configure
- Add your app credentials like
appId
,region
, andauthKey
in thelib/consts.dart
file. - If you are using FCM then add the
fcmProviderId
in thelib/consts.dart
file. - If you are using APN then add the
apnProviderId
in thelib/consts.dart
file. - Once the app is running on your device or emulator, login with a user.
- Allow the permission to display push notifications.
- Put the app in the background or terminate it.
- Send a message or call to the logged in user from another device.
- You should see a push notification for a message and call notification for a call.
- Tap on the notification to open the Sample app for message.
- Tap on accept/decline on call notification to initiate or decline call.
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.