From d05ba1f179a853ccbc4e445b43e38da928c50623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Bousqui=C3=A9?= Date: Wed, 13 Nov 2024 15:35:02 +0100 Subject: [PATCH 1/3] Update README.md Added the required permissions in the geolocation plugin documentation so that the code example can run. --- plugins/geolocation/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/geolocation/README.md b/plugins/geolocation/README.md index 0557cc9892..2bb8ee468d 100644 --- a/plugins/geolocation/README.md +++ b/plugins/geolocation/README.md @@ -91,7 +91,16 @@ fn main() { .expect("error while running tauri application"); } ``` - +Then, for instance, grant the plugin the permission to check or request permissions from the user and to read the device position in the file `src-tauri/capabilities/default.json` +``` + "permissions": [ + "core:default", + "geolocation:allow-check-permissions", + "geolocation:allow-request-permissions", + "geolocation:allow-get-current-position", + "geolocation:allow-watch-position", + ] +``` Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript From 879813032f9ff89cb7d65a11590f227c26251299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Bousqui=C3=A9?= Date: Wed, 13 Nov 2024 15:44:49 +0100 Subject: [PATCH 2/3] Update README.md prettier changes --- plugins/geolocation/README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/geolocation/README.md b/plugins/geolocation/README.md index 2bb8ee468d..b76dc26c0b 100644 --- a/plugins/geolocation/README.md +++ b/plugins/geolocation/README.md @@ -91,8 +91,12 @@ fn main() { .expect("error while running tauri application"); } ``` -Then, for instance, grant the plugin the permission to check or request permissions from the user and to read the device position in the file `src-tauri/capabilities/default.json` -``` + +Then, for instance, grant the plugin the permission to check or request permissions from the user and to read the device position + +`src-tauri/capabilities/default.json` + +```json "permissions": [ "core:default", "geolocation:allow-check-permissions", @@ -101,6 +105,7 @@ Then, for instance, grant the plugin the permission to check or request permissi "geolocation:allow-watch-position", ] ``` + Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript From 0ea0fdb7251b9077617a3472576c50044194f0ca Mon Sep 17 00:00:00 2001 From: amrbashir Date: Thu, 14 Nov 2024 17:57:07 +0200 Subject: [PATCH 3/3] fmt --- plugins/geolocation/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/geolocation/README.md b/plugins/geolocation/README.md index b76dc26c0b..b8cadf0815 100644 --- a/plugins/geolocation/README.md +++ b/plugins/geolocation/README.md @@ -92,7 +92,7 @@ fn main() { } ``` -Then, for instance, grant the plugin the permission to check or request permissions from the user and to read the device position +Then, for instance, grant the plugin the permission to check or request permissions from the user and to read the device position `src-tauri/capabilities/default.json`