Closed asharghi closed 1 year ago
@asharghi Very nice fix. Since we always try to keep support for older devices, we could perhaps add a workaround for older APIs. Before API 29, we were provided with versions of method vibrate
which were eventually deprecated (example: https://developer.android.com/reference/android/os/Vibrator#vibrate(long[],%20int)).
In this post, somebody has emulated double and heavy click for older devices: https://stackoverflow.com/a/60233086
With a bit of tweaking we might be able to add click effect too (should be simplier than the two mentioned above).
Thanks for the feedback. With this PR, I’m not removing support for old devices since it’s not supported in the first place. Just want to prevent a crash with this PR. Hope it will do for now.
Available in 3.0.2 now.
Haptics will crash Android devices on version 9 because some of the constants used was not added before sdk version 29. Added a sdk version check
Example of constant: https://developer.android.com/reference/android/os/VibrationEffect#EFFECT_CLICK