Push notifications with FCM
Hi there, we have a live app built on FlutterFlow and are running into an issue where the app icon notification badge does not appear on iOS when a push notification is triggered, but works on Android. According to FlutterFlow, they are blocked from solving this issue due to the following Firebase bug (https://github.com/firebase/flutterfire/issues/9563).
Using Buildship, is there a way to listen to the incoming FCM push notifications and update the recipient’s badge count? Or perhaps set a periodic background listener to update the badge count? Any workarounds would be incredibly helpful.
Thanks so much in advance for your help.
Using Buildship, is there a way to listen to the incoming FCM push notifications and update the recipient’s badge count? Or perhaps set a periodic background listener to update the badge count? Any workarounds would be incredibly helpful.
Thanks so much in advance for your help.
GitHub
A collection of Firebase plugins for Flutter apps. - Issues · firebase/flutterfire
Solution
This is worth a try. I've updated the Flutterflow Notifications node to add the badge count for iOS in the format FCM requires.
A few things to remember with badgeCount, however...
1. Value Type: The badge count (badgeCount) should be a non-negative integer. Negative values are not valid and may be ignored or lead to unexpected behavior.
2. Updating the Badge Count: The badge count set via push notification is entirely controlled by the server-sent payload. It's not automatically incremented or decremented by iOS; your server needs to track and send the correct count based on the app's specific logic (e.g., number of unread messages).
3. Resetting the Badge Count: To remove the badge, send a push notification with the badge count set to 0.
A few things to remember with badgeCount, however...
1. Value Type: The badge count (badgeCount) should be a non-negative integer. Negative values are not valid and may be ignored or lead to unexpected behavior.
2. Updating the Badge Count: The badge count set via push notification is entirely controlled by the server-sent payload. It's not automatically incremented or decremented by iOS; your server needs to track and send the correct count based on the app's specific logic (e.g., number of unread messages).
3. Resetting the Badge Count: To remove the badge, send a push notification with the badge count set to 0.
message.txt6.51KB
