From 9c6c7fd5cd4278c95fad1f8d2921cdbb10416149 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Tue, 6 Jan 2026 12:08:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E8=AE=BE=E7=BD=AE=E5=B9=B6=E5=9C=A8=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E6=BF=80=E6=B4=BB=E6=97=B6=E9=87=8D=E7=BD=AE=E5=BE=BD?= =?UTF-8?q?=E7=AB=A0=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除SetReminderHandler中的通知徽章设置,避免重复显示 在AppDelegate中添加应用启动和激活时的徽章数重置逻辑 --- ios/Runner/AppDelegate.swift | 6 ++++++ .../chat_api/Sources/chat_api/SystemFunctionHandler.swift | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index e04182a8a..c89921208 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -7,9 +7,15 @@ import UIKit _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { + application.applicationIconBadgeNumber = 0 GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + override func applicationDidBecomeActive(_ application: UIApplication) { + application.applicationIconBadgeNumber = 0 + super.applicationDidBecomeActive(application) + } // 添加URL回调监听 override func application( diff --git a/local_plugins/chat_api/ios/chat_api/Sources/chat_api/SystemFunctionHandler.swift b/local_plugins/chat_api/ios/chat_api/Sources/chat_api/SystemFunctionHandler.swift index cc7613322..9112f82f8 100644 --- a/local_plugins/chat_api/ios/chat_api/Sources/chat_api/SystemFunctionHandler.swift +++ b/local_plugins/chat_api/ios/chat_api/Sources/chat_api/SystemFunctionHandler.swift @@ -823,7 +823,6 @@ private class SetReminderHandler: FunctionHandler { let notificationContent = UNMutableNotificationContent() notificationContent.title = title notificationContent.body = content - notificationContent.badge = 1 // 关键配置:闹钟级声音(突破静音,最大音量) notificationContent.sound = UNNotificationSound.criticalSoundNamed(