Skip to content

Commit

Permalink
Fix iOS volume type error
Browse files Browse the repository at this point in the history
  • Loading branch information
gdelataillade committed Nov 18, 2023
1 parent 2fecf4f commit 6481087
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ios/Classes/SwiftAlarmPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,13 @@ public class SwiftAlarmPlugin: NSObject, FlutterPlugin {
let loopAudio = args["loopAudio"] as! Bool
let fadeDuration = args["fadeDuration"] as! Double
let vibrationsEnabled = args["vibrate"] as! Bool
let volume = args["volume"] as? Float
let volume = args["volume"] as? Double
let assetAudio = args["assetAudio"] as! String

var volumeFloat: Float? = nil
if let volumeValue = volume {
volumeFloat = Float(volumeValue)
}

if assetAudio.hasPrefix("assets/") {
let filename = registrar.lookupKey(forAsset: assetAudio)
Expand Down Expand Up @@ -142,7 +147,7 @@ public class SwiftAlarmPlugin: NSObject, FlutterPlugin {
fadeDuration: fadeDuration,
vibrationsEnabled: vibrationsEnabled,
audioLoop: loopAudio,
volume: volume
volume: volumeFloat
)
})

Expand Down

0 comments on commit 6481087

Please sign in to comment.