flutter_app_badger: ^1.2.0 copied to clipboard
Plugin to update the app badge on the launcher (both for Android and iOS)
Flutter App Badger plugin #
This plugin for Flutter adds the ability to change the badge of the app in the launcher. It supports iOS and some Android devices (the official API does not support the feature, even on Oreo).
Getting Started #
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 Info.plist:
<key>UIBackgroundModes</key> <array> <string>remote-notification</string> </array>
On Android, no official API exists to show a badge in the launcher. But some devices (Samsung, HTC...) support the feature. Thanks to the Shortcut Badger library, ~ 16 launchers are supported.
First, you just have to import the package in your dart files with:
Then you can add a badge:
Remove a badge:
Or just check if the device supports this feature with: