Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter show app icon badge on push notification

I'm looking for a way to show an app icon badge when a user receives a push notification.

I'm using the Firebase_messaging plugin for flutter for the handling of the push notifications and flutter_app_badger for the app icon badges. But I want to combine the two so that the number is set on the icon without opening the app. Is it possible to make this happen? Or am I overlooking something obvious from the firebase_messaging plugin?

Sorry for the horrible explanation. I hope someone can help me with this issue.

like image 232
Kevin Walter Avatar asked Nov 20 '18 09:11

Kevin Walter


People also ask

How do you get the notification badge in Flutter?

Create an IconButton inside Stack and use Positioned widget to set the child of Positioned widget which will a be Text widget over the IconButton . The Text widget will be used to show the count of notifications. In the above code, we are checking whether the value of counter is greater than 0 to not.

How do I get notifications for icons?

Turn on App icon badges from Settings. Navigate back to the main Settings screen, tap Notifications, and then tap Advanced settings. Tap the switch next to App icon badges to turn them on.


1 Answers

App icon badge depends on the Application Launcher

Some of the Android Application Launcher includes this functionality by default, You can check this on Settings->Apps->Notification Attached image

FYI

  • How to show notification count on app icon like Facebook?

  • How does Facebook add badge numbers on app icon in Android?

  • adding notification badge on app icon in android

like image 159
ajay Avatar answered Oct 22 '22 07:10

ajay