Open httpjamesm opened 1 week ago
For more context the discord discussion that started after i asked for more testers (mostly me talking lol): https://discord.com/channels/616186924390023171/618328921330417692/1304856255269048430
Do you have the Haptic Feedback OS setting disabled? The APIs are fairly sensitive to that apparently. A short summary of the linked discord messages:
With haptic feedback disabled:
vibrate()
only works with values (those are in miliseconds btw) above 1000. So 1001 vibrates, 1000 and below doesn't
With haptic feedback enabled:
vibrate()
works with values below 1000if you could confirm this behavior on your end that would be much appreciated - Edit: Don't forget to enable the haptics apis in the capabilities file. Since i forgot to push the Guide this seems to be a common mistake
Now the question is how to solve this. Is this just something that should be documented? Or should we add the workarounds and make the apis work regardless of the user's settings?
If it matters, i stole the timings/amplitudes from other projects, mainly the capacitor plugin.
Issue resolved. These permissions need to be added to the default.json capabilities file rather than just haptics:default
:
[
"haptics:allow-vibrate",
"haptics:allow-impact-feedback",
"haptics:allow-selection-feedback",
"haptics:allow-notification-feedback"
]
Attempting to call any of the four vibration functions from the haptics (@tauri-apps/plugin-haptics) plugin does nothing. No errors are returned nor sent in the device logs.
Using:
~2