Open RuiTB opened 4 weeks ago
Same issue, my badge when calling AppBadgePlus.updateBadge(0) on Android doesn't work
@RuiTB @quocviet1996 Could you please offser me your device brand and os version?
Starting with Android 8.0 (API level 26), notification badges—also known as notification dots—appear on a launcher icon when the associated app has an active notification. Users can touch & hold the app icon to reveal the notifications, along with any app shortcuts.
@windows7lake my device is a Samsung a22 5g with Android 13 and One UI 5.1
@RuiTB Sorry. I had try to figure out a solution to solve this problem. But find no way form samsung develper website. It seems to have nothing to do on it, the badges just control by launcher.
According to the description of the official open document of Android:
Starting with Android 8.0 (API level 26), notification badges—also known as notification dots—appear on a launcher icon when the associated app has an active notification. Users can touch & hold the app icon to reveal the notifications, along with any app shortcuts.
@RuiTB I think You should use system default Badge, actually you should use this package under Android 12. From Android 12, I believe android system manage the badges you should not override it.
static const int _androidAutoManageBadgeVersion = 31;
bool get _isAndroidAutoManageBadge {
final versionString = Platform.operatingSystemVersion.split(' ')[1];
final versionNumber = int.tryParse(versionString.split('.')[0]) ?? 0;
return versionNumber >= _androidAutoManageBadgeVersion;
}
if (!_isAndroidAutoManageBadge) {
// process your logic
}
I hope it helps
when calling AppBadgePlus.updateBadge(0) on Android the app badge number stop depending on the package and start counting the notifications in the notification drawer
expected to completely remove the number