twostraws / CodeScanner

A SwiftUI view that is able to scan barcodes, QR codes, and more, and send back what was found.
MIT License
1.02k stars 293 forks source link

Turning off vibration on scan #36

Closed deepak013 closed 2 years ago

deepak013 commented 3 years ago

There is no feature to turning vibration on and off. Can you please add this in next release.

matthijn commented 3 years ago

This indeed. I'd like to be able to have a different vibration on an invalid scan (eg the QR may be valid to scan, but is not known in my system). If I could toggle the vibration off here, then it would be not an issue.

edit: Looking through the code I don't see where the vibrator is called, is that an iOS thing that it does that always when it detects a QR?

pgz285 commented 3 years ago

Changing this place to 1520 can change the intensity of the vibration image

twostraws commented 2 years ago

Vibration is enabled by default in 2.0.0, but can be disabled by passing shouldVibrateOnSuccess: false into the initializer.