Skip to content

Commit

Permalink
Fix iOS isRinging method
Browse files Browse the repository at this point in the history
  • Loading branch information
gdelataillade committed Nov 12, 2024
1 parent 8e85a09 commit 2f4dcec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ios/Classes/SwiftAlarmPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ public class SwiftAlarmPlugin: NSObject, FlutterPlugin {
}
self.stopAlarm(id: id, cancelNotif: true, result: result)
case "isRinging":
let id = call.arguments as? Int
if id == nil {
result(self.isAnyAlarmRinging())
if let arguments = call.arguments as? [String: Any],
let id = arguments["id"] as? Int {
result(self.alarms[id]?.audioPlayer?.isPlaying ?? false)
} else {
result(self.alarms[id!]?.audioPlayer?.isPlaying ?? false)
result(self.isAnyAlarmRinging())
}
case "setWarningNotificationOnKill":
guard let args = call.arguments as? [String: Any] else {
Expand Down

0 comments on commit 2f4dcec

Please sign in to comment.