Push notification
#
PrerequisitesYour flutter app should have a firebase cloud messaging integration to receive push notifications. Refer this doc to continue firebase cloud messaging integration
To Show Message Notifications in app foreground
Refer this Message Notification's
#
Add runtime permissions for push notificationFrom Android 13
, To receive notification message, we need below permissions:
#
Updating fcm device tokenYou need to update the fcm device token to the server, so that server can send push notificationns by using the updated fcm device token. if you want to update the fcm device token, you can utilise the below method.
Argument | Type | Description |
---|---|---|
FCM_TOKEN | String | fcm device token |
flyCallback | FlyResponse | callback to observe the action status |
#
Handling the received chat fcm messageUpon receiving a Firebase push notification in your Firebase Messaging service, you can utilize the following method to retrieve the notification content and subsequently create and display the notification.
- Dart
- Response
#
Get unread count without muted chat messagesIf you need a unread count excluding the muted chat messages, you can utilise the below method.