@tauri-apps/plugin-geolocation 2.0.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +17 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -12,7 +12,7 @@ This plugin provides APIs for getting and tracking the device's current position
12
12
 
13
13
  ## Install
14
14
 
15
- _This plugin requires a Rust version of at least **1.78**_
15
+ _This plugin requires a Rust version of at least **1.77.2**_
16
16
 
17
17
  There are three general methods of installation that we can recommend.
18
18
 
@@ -81,7 +81,7 @@ The Google Play Store uses this property to decide whether it should show the ap
81
81
 
82
82
  First you need to register the core plugin with Tauri:
83
83
 
84
- `src-tauri/src/main.rs`
84
+ `src-tauri/src/lib.rs`
85
85
 
86
86
  ```rust
87
87
  fn main() {
@@ -92,6 +92,20 @@ fn main() {
92
92
  }
93
93
  ```
94
94
 
95
+ Then, for instance, grant the plugin the permission to check or request permissions from the user and to read the device position
96
+
97
+ `src-tauri/capabilities/default.json`
98
+
99
+ ```json
100
+ "permissions": [
101
+ "core:default",
102
+ "geolocation:allow-check-permissions",
103
+ "geolocation:allow-request-permissions",
104
+ "geolocation:allow-get-current-position",
105
+ "geolocation:allow-watch-position",
106
+ ]
107
+ ```
108
+
95
109
  Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
96
110
 
97
111
  ```javascript
@@ -100,7 +114,7 @@ import {
100
114
  requestPermissions,
101
115
  getCurrentPosition,
102
116
  watchPosition
103
- } from '@tauri-apps/plugin-log'
117
+ } from '@tauri-apps/plugin-geolocation'
104
118
 
105
119
  let permissions = await checkPermissions()
106
120
  if (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tauri-apps/plugin-geolocation",
3
- "version": "2.0.0",
3
+ "version": "2.2.1",
4
4
  "license": "MIT OR Apache-2.0",
5
5
  "authors": [
6
6
  "Tauri Programme within The Commons Conservancy"