From 92019275e4f0568241c3f1efe8229c1f31ed56f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nh=E1=BA=ADt=20Long?= <116779782+longtn-imt@users.noreply.github.com> Date: Mon, 11 Mar 2024 17:31:31 +0700 Subject: [PATCH] fix(iOS): SwiftAlarmPlugin.scheduleAppRefresh() EXC_BAD_ACCESS (#161) * fix(iOS): SwiftAlarmPlugin.scheduleAppRefresh() EXC_BAD_ACCESS * fix: Can't multi listen alarm --- ios/Classes/SwiftAlarmPlugin.swift | 2 +- lib/alarm.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Classes/SwiftAlarmPlugin.swift b/ios/Classes/SwiftAlarmPlugin.swift index d19ca3f4..136abc68 100644 --- a/ios/Classes/SwiftAlarmPlugin.swift +++ b/ios/Classes/SwiftAlarmPlugin.swift @@ -146,8 +146,8 @@ public class SwiftAlarmPlugin: NSObject, FlutterPlugin { DispatchQueue.main.async { self.alarms[id]?.timer = Timer.scheduledTimer(timeInterval: delayInSeconds, target: self, selector: #selector(self.executeTask(_:)), userInfo: id, repeats: false) - SwiftAlarmPlugin.scheduleAppRefresh() } + SwiftAlarmPlugin.scheduleAppRefresh() } result(true) } else { diff --git a/lib/alarm.dart b/lib/alarm.dart index c307d26f..80ea4ae6 100644 --- a/lib/alarm.dart +++ b/lib/alarm.dart @@ -22,7 +22,7 @@ class Alarm { static bool get android => defaultTargetPlatform == TargetPlatform.android; /// Stream of the ringing status. - static final ringStream = StreamController(); + static final ringStream = StreamController.broadcast(); /// Initializes Alarm services. ///