A Flutter plugin for managing app icon badges.
On iOS, the notification permission is required to update the badge. It is automatically asked when the badge is added or removed.
Please also add the following to your YOUR_PROJECT/ios/Runner/Info.plist:
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
iOS 16+ uses UNUserNotificationCenter.setBadgeCount
iOS 15 and below uses UIApplication.applicationIconBadgeNumber
On macOS, the notification permission is required to update the badge. It is automatically asked when the badge is added or removed.
Please also add the following to your YOUR_PROJECT/macos/Runner/Info.plist:
<key>NSUserNotificationAlertStyle</key>
<string>banner</string>
On Android, we are using ShortcutBadgerX library which supports 19 launchers.
import the package in your dart files with:
import 'package:native_app_badger/flutter_app_badger.dart';
Add badge:
NativeAppBadger.updateBadgeCount(1);
Remove the badge or reset to 0:
NativeAppBadger.removeBadge();
You can check if the current device supports badges:
NativeAppBadger.isAppBadgeSupported();