From 5683a822349c4b0512aa0fdd5ca3e0faee248cfd Mon Sep 17 00:00:00 2001 From: Dominic Moser Date: Mon, 3 Feb 2025 21:57:37 -0700 Subject: [PATCH] Additional documentation for Haptics to make it properly work on-device Initially when trying to use the haptics it mysteriously wasn't working. I resolved the issue using #2023, the examples were updated but the above file was not. --- plugins/haptics/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/haptics/README.md b/plugins/haptics/README.md index e5f0e697..3678f17b 100644 --- a/plugins/haptics/README.md +++ b/plugins/haptics/README.md @@ -69,6 +69,18 @@ fn main() { } ``` +Second, add the required permissions in the project: + +`src-tauri/capabilities/default.json` + +```rust + "permissions": [ + +"haptics:allow-impact-feedback", + +"haptics:allow-notification-feedback", + +"haptics:allow-selection-feedback", + +"haptics:allow-vibrate" + ]``` + Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript