You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.
We tried this code: @override void didChangeAppLifecycleState(AppLifecycleState state) { switch (state) { case AppLifecycleState.resumed: log("MyApp: AppLifecycaeState.resumed"); FlutterAppBadger.removeBadge(); break; case AppLifecycleState.paused: updateMyActiveStatus(false); log("MyApp: AppLifecycleState.paused"); break; case AppLifecycleState.inactive: log("MyApp: AppLifecycleState.inactive"); break; case AppLifecycleState.detached: log("MyApp: AppLifecycleState.detached"); break; default: break; } Code in pastebin
We also tried this code:
@override void didChangeAppLifecycleState(AppLifecycleState state) { switch (state) { case AppLifecycleState.resumed: log("MyApp: AppLifecycaeState.resumed"); break; case AppLifecycleState.paused: updateMyActiveStatus(false); log("MyApp: AppLifecycleState.paused"); FlutterAppBadger.removeBadge(); break; case AppLifecycleState.inactive: log("MyApp: AppLifecycleState.inactive"); break; case AppLifecycleState.detached: l log("MyApp: AppLifecycleState.detached"); break; default: break; }
or Code in Pastebin
Neither works. Is this our code or an issue with the plugin?
Thanks for your insight.
The text was updated successfully, but these errors were encountered:
Android does not offer the same badge display functionality at the OS level as iOS. They are provided at the API level by the manufacturer of the device or launcher application (e.g. MicrosoftLauncher). Basically, Android should not support Badge display and should conform to the specifications of the OS, launcher app, and device.
Incidentally, on Android, you can remove the badge display by writing the following code on the native side at startup and calling it from Flutter.
However, this will also remove the notification from the Notification Center.
val notificationManager = applicationContext.getSystemService(Context.NOTIFICATION_SERVICE) asNotificationManager
notificationManager.cancelAll()
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We are completing a chat app in flutter using this plugin.
Our chat app runs on Firestore.
When there are unread messages, we would like the app to display a badge reminding our users there are messages to check.
Our users would like to see the badge reset to zero and the badge disappears after the messages are all checked.
The first part showing the badge when there are unread messages work well. However, after checking the message, the badge does not reset.
This is our screenplay.
Screenplay - Badge does not reset.
We tried this code:
@override void didChangeAppLifecycleState(AppLifecycleState state) { switch (state) { case AppLifecycleState.resumed: log("MyApp: AppLifecycaeState.resumed"); FlutterAppBadger.removeBadge(); break; case AppLifecycleState.paused: updateMyActiveStatus(false); log("MyApp: AppLifecycleState.paused"); break; case AppLifecycleState.inactive: log("MyApp: AppLifecycleState.inactive"); break; case AppLifecycleState.detached: log("MyApp: AppLifecycleState.detached"); break; default: break; }
Code in pastebin
We also tried this code:
@override void didChangeAppLifecycleState(AppLifecycleState state) { switch (state) { case AppLifecycleState.resumed: log("MyApp: AppLifecycaeState.resumed"); break; case AppLifecycleState.paused: updateMyActiveStatus(false); log("MyApp: AppLifecycleState.paused"); FlutterAppBadger.removeBadge(); break; case AppLifecycleState.inactive: log("MyApp: AppLifecycleState.inactive"); break; case AppLifecycleState.detached: l log("MyApp: AppLifecycleState.detached"); break; default: break; }
or Code in Pastebin
Neither works. Is this our code or an issue with the plugin?
Thanks for your insight.
The text was updated successfully, but these errors were encountered: