@capacitor/geolocation 7.1.1-pr.25 → 7.1.2

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ionic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -326,13 +326,16 @@ class GeolocationPlugin : Plugin() {
326
326
  * @return IONGLOCLocationOptions object
327
327
  */
328
328
  private fun createOptions(call: PluginCall): IONGLOCLocationOptions {
329
- val timeout = call.getLong("timeout", 10000) ?: 10000
330
- val maximumAge = call.getLong("maximumAge", 0) ?: 0
329
+ val timeout = call.getNumber("timeout", 10000)
330
+ val maximumAge = call.getNumber("maximumAge", 0)
331
331
  val enableHighAccuracy = call.getBoolean("enableHighAccuracy", false) ?: false
332
- val minimumUpdateInterval = call.getLong("minimumUpdateInterval", 5000) ?: 5000
332
+ val minimumUpdateInterval = call.getNumber("minimumUpdateInterval", 5000)
333
333
 
334
334
  val locationOptions = IONGLOCLocationOptions(timeout, maximumAge, enableHighAccuracy, minimumUpdateInterval)
335
335
 
336
336
  return locationOptions
337
337
  }
338
+
339
+ private fun PluginCall.getNumber(name: String, defaultValue: Long): Long =
340
+ getLong(name) ?: getInt(name)?.toLong() ?: defaultValue
338
341
  }
@@ -84,11 +84,11 @@ public class GeolocationPlugin: CAPPlugin, CAPBridgedPlugin {
84
84
 
85
85
  private extension GeolocationPlugin {
86
86
  func shouldSetupBindings() {
87
- bindauthorisationStatusPublisher()
87
+ bindAuthorisationStatusPublisher()
88
88
  bindLocationPublisher()
89
89
  }
90
90
 
91
- func bindauthorisationStatusPublisher() {
91
+ func bindAuthorisationStatusPublisher() {
92
92
  guard !statusInitialized else { return }
93
93
  statusInitialized = true
94
94
  locationService?.authorisationStatusPublisher
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/geolocation",
3
- "version": "7.1.1-pr.25",
3
+ "version": "7.1.2",
4
4
  "description": "The Geolocation API provides simple methods for getting and tracking the current position of the device using GPS, along with altitude, heading, and speed information if available.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",