Skip to content
This repository was archived by the owner on Jul 11, 2024. It is now read-only.
This repository was archived by the owner on Jul 11, 2024. It is now read-only.

We can not reset the app badge in some android devices #71

@gujingc

Description

@gujingc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions