Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions vibration/ios/Classes/VibrationPluginSwift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,15 @@ public class VibrationPluginSwift: NSObject, FlutterPlugin {
try player.start(atTime: 0)
}
} catch {
print("Failed to play pattern: \(error.localizedDescription).")
print("Failed to play pattern: \(error.localizedDescription). Play default.")
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
}
}
@available(iOS 13.0, *)
private func cancelVibration() {
VibrationPluginSwift.engine?.stop(completionHandler: { error in
if let error = error {
print("Error stopping haptic engine: \(error)")
} else {
print("Haptic engine stopped successfully.")
}
})
}
Expand Down