From f6f948769e0aa78e086cbff48043c0fa624b8a19 Mon Sep 17 00:00:00 2001
From: Matthias Nott <mnott@mnsoft.org>
Date: Wed, 01 Apr 2026 13:08:42 +0200
Subject: [PATCH] fix: clear badge on app open and foreground

---
 ios/Runner/AppDelegate.swift |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift
index 194fe1c..046a9dd 100644
--- a/ios/Runner/AppDelegate.swift
+++ b/ios/Runner/AppDelegate.swift
@@ -8,6 +8,8 @@
     _ application: UIApplication,
     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
   ) -> Bool {
+    application.applicationIconBadgeNumber = 0
+    if #available(iOS 16.0, *) { UNUserNotificationCenter.current().setBadgeCount(0) }
     return super.application(application, didFinishLaunchingWithOptions: launchOptions)
   }
 
@@ -19,6 +21,7 @@
   override func applicationDidBecomeActive(_ application: UIApplication) {
     super.applicationDidBecomeActive(application)
     application.applicationIconBadgeNumber = 0
+    if #available(iOS 16.0, *) { UNUserNotificationCenter.current().setBadgeCount(0) }
   }
 
   // Forward APNs token registration to the push plugin

--
Gitblit v1.3.1