Skip to content

Commit

Permalink
Try to improve interruptions handling
Browse files Browse the repository at this point in the history
  • Loading branch information
gdelataillade committed Sep 13, 2023
1 parent 1594c7b commit e06cf9d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ios/Classes/SwiftAlarmPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ public class SwiftAlarmPlugin: NSObject, FlutterPlugin {

switch type {
case .began:
self.silentAudioPlayer?.play()
NSLog("SwiftAlarmPlugin: Interruption began")
case .ended:
self.silentAudioPlayer?.play()
Expand Down Expand Up @@ -246,6 +247,8 @@ public class SwiftAlarmPlugin: NSObject, FlutterPlugin {
}

private func stopAlarm(id: Int, result: FlutterResult) {
self.mixOtherAudios()

self.vibrate = false
if self.previousVolume != nil {
self.setVolume(volume: self.previousVolume!, enable: false)
Expand Down

0 comments on commit e06cf9d

Please sign in to comment.