app_badger 3.1.2
app_badger: ^3.1.2 copied to clipboard
A Flutter plugin to manage app badge counts on Android, iOS, and macOS with modern Swift Package Manager and federated architecture support.
Changelog #
3.1.2 - 2026-08-20 #
Changed #
- Updated release metadata and package versioning to 3.1.2.
- Kept the package API distinct with
AppBadgeControlleras the primary public interface. - Reduced naming collisions with common upstream badge-plugin patterns.
- Kept compatibility wrappers for older
AppBadgercalls while documenting the newer API. - Refined the monorepo workflow and public project documentation for a cleaner, independent project presentation.
Fixed #
- Consolidated the release documentation so README and workspace metadata reflect the current package state.
- Ensured plugin package metadata stays consistent across the monorepo.
3.1.0 - 2026-08-12 #
Changed #
- Federated Architecture: Migrated the plugin to a federated structure for better maintainability and platform separation.
- Swift Package Manager: Adopted Swift Package Manager (SPM) for iOS and macOS implementation packages, following the new recommended structure for Flutter 3.22+.
app_badger: App-facing package (root).app_badger_platform_interface: Common platform interface.app_badger_android: Android implementation.app_badger_ios: iOS implementation.app_badger_macos: macOS implementation.
Fixed #
- Android Compilation: Fixed unresolved reference to
RequestPermissionsResultListenerand improved type inference in Kotlin plugin code. - Android Imports: Corrected
io.flutter.plugin.common.PluginRegistryimports. - Reliability: Improved robustness of Android runtime permission handling.
3.0.1 - 2026-08-09 #
Patch Release: Bug fixes and polishing #
This patch fixes runtime issues and adds quality-of-life improvements after the 3.0.0 release. Highlights:
Fixed #
- Proper Android runtime permission flow:
requestNotificationPermission()now waits for the user decision and returns the final granted/denied result (fixes incorrect immediate return behavior). - Optional Android notification posting:
updateBadgeCount(..., postNotification: false)now prevents the plugin from posting the low-priority notification (useful for apps that don't want persistent notifications). - iOS
isBadgeSupportedsemantics corrected: plugin now inspectsUNUserNotificationCentersettings to determine effective badge capability instead of relying on remote notification registration. - Cross-platform event stream (
AppBadger.events) implemented to notify Dart of native events (badgeUpdated, badgeRemoved, permission results). - Persist badge count on iOS/macOS (UserDefaults) to provide consistent
getBadgeCount()behavior across platforms.
Changed #
- Example app updated with a modern Material 3 UI, responsive layout, and event history view.
- Documentation updated to include EventChannel usage and Android notification configuration helper.
Notes #
- See README for updated usage examples and the new
postNotificationandsetAndroidNotificationConfigAPIs.
3.0.0 - 2026-08-04 #
2.0.4 - 2026-08-02 #
Fixed #
- iOS SPM package identity: Corrected
Package.swiftto useapp-badger, matching Flutter's Swift Package Manager convention. - Flutter iOS integration warnings: Resolves recent
Plugin does not support Swift Package Manager for ioswarnings. - Complete SPM support: Confirms the plugin ships with the required
Package.swiftproduct declarations for Flutter 3.22+.
2.0.3 - 2026-08-02 #
Fixed #
- iOS SPM follow-up: Additional Swift Package Manager compatibility adjustments for the 2.0.x release line.
2.0.2 - 2026-08-02 #
Fixed #
- Initial iOS SPM corrections: Began aligning package identity and package manifest support for Flutter 3.22+.
2.0.1 - 2026-08-02 #
Fixed #
- iOS SPM Support: Removed unnecessary Package.swift that was causing conflicts. Flutter handles SPM plugin integration automatically.
- Resolved package identity conflicts: Fixes "unable to override package" errors when using app_badger with pub.dev
- Improved build reliability: Cleaner iOS build system leveraging Flutter's automatic SPM handling
2.0.0 - 2026-08-01 #
Added #
- Automatic permission request: New
AppBadger.requestNotificationPermission()method for requestingPOST_NOTIFICATIONS(Android 13+) and notification permissions (iOS) on app startup - Notification-based badge fallback: Dual-path badge delivery using ShortcutBadger (primary) + system notifications (fallback) for improved reliability on modern Android devices
- ActivityAware interface: Android plugin now implements ActivityAware for proper runtime permission handling
- Comprehensive logging: Added detailed AppBadger logs for debugging badge lifecycle (apply, clear, notification posts)
- Enhanced documentation: Complete README rewrite with platform requirements, migration guide, troubleshooting, and FAQ sections
- Example app improvements: Updated example to demonstrate permission request on startup and show real-time permission status
Changed #
- iOS: Migrated plugin to Swift Package Manager (SPM) layout for Flutter 3.22+ compatibility
- iOS: Removed all CocoaPods integration from plugin and example app
- iOS: Added UIScene lifecycle support for modern iOS app architecture
- Android: Migrated build to built-in Kotlin path for AGP 8.11+/9+ readiness
- Android: Removed plugin-side Kotlin Gradle Plugin application (only needed at app level)
- Android: Updated example to use AGP 8.11.1, Kotlin 2.2.20, Gradle 8.14.1
- Android: Added
POST_NOTIFICATIONSpermission to plugin and example manifests - iOS: Updated example Info.plist with notification usage description
- Documentation: Rewrote README with version highlights, platform requirements, and complete API examples
Fixed #
- Android runtime crash: Removed invalid XiaomiHomeBadger broadcast receiver from example manifest (was causing ClassCastException)
- iOS build errors: Resolved CocoaPods conflicts by switching to Swift Package Manager
- Badge permission handling: Plugin now properly requests and handles notification permissions on both platforms
- Background badge behavior: Documented Android launcher limitation and provided workarounds
Removed #
- ❌ iOS CocoaPods integration (use SPM instead)
- ❌ XiaomiHomeBadger broadcast receiver from example (no longer needed)
- ❌ Plugin-side Kotlin Gradle Plugin (use AGP built-in support)
Known Limitations #
- Android background badge disappearance: Many launchers clear badge when app backgrounded (launcher-specific behavior)
- Device-specific badge support: Varies by manufacturer (Samsung, Xiaomi, etc. require specific permissions)
Migration from 1.x #
- iOS: Delete Podfile and Pods directory, run
flutter clean - Android: Update app build.gradle.kts to use AGP 8.11+ and built-in Kotlin
- Both platforms: Call
AppBadger.requestNotificationPermission()on app startup - Android: Ensure
POST_NOTIFICATIONSpermission in AndroidManifest.xml - iOS: Ensure
NSUserNotificationUsageDescriptionin Info.plist