@capacitor/geolocation 8.2.0 → 8.2.1-next.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.
package/README.md CHANGED
@@ -16,13 +16,16 @@ Apple requires privacy descriptions to be specified in `Info.plist` for location
16
16
  - `NSLocationAlwaysAndWhenInUseUsageDescription` (`Privacy - Location Always and When In Use Usage Description`)
17
17
  - `NSLocationWhenInUseUsageDescription` (`Privacy - Location When In Use Usage Description`)
18
18
 
19
- > [!NOTE]
20
- > This Capacitor plugin does not support background geolocation directly. However, it relies on
21
- > [`ion-ios-geolocation`](https://github.com/ionic-team/ion-ios-geolocation), which can report
22
- > location in the background. As a result, Apple requires you to include a
23
- > `NSLocationAlwaysAndWhenInUseUsageDescription` entry in your `Info.plist`. Since this permission
24
- > prompt won’t appear to users, you can safely use the same description string as for
25
- > `NSLocationWhenInUseUsageDescription`.
19
+ :::info[Background Location Usage Strings]
20
+
21
+ This Capacitor plugin does not support background geolocation directly. However, it relies on
22
+ [`ion-ios-geolocation`](https://github.com/ionic-team/ion-ios-geolocation), which can report
23
+ location in the background. As a result, Apple requires you to include a
24
+ `NSLocationAlwaysAndWhenInUseUsageDescription` entry in your `Info.plist`. Since this permission
25
+ prompt won’t appear to users, you can safely use the same description string as for
26
+ `NSLocationWhenInUseUsageDescription`.
27
+
28
+ :::info
26
29
 
27
30
  Read about [Configuring `Info.plist`](https://capacitorjs.com/docs/ios/configuration#configuring-infoplist) in the [iOS Guide](https://capacitorjs.com/docs/ios) for more information on setting iOS permissions in Xcode
28
31
 
@@ -39,6 +42,12 @@ This plugin requires the following permissions be added to your `AndroidManifest
39
42
 
40
43
  The first two permissions ask for location data, both fine and coarse, and the last line is optional but necessary if your app _requires_ GPS to function. You may leave it out, though keep in mind that this may mean your app is installed on devices lacking GPS hardware.
41
44
 
45
+ :::note
46
+
47
+ If you only require approximate location (variable accuracy but usually around 2 kilometers), you may just declare `ACCESS_COARSE_LOCATION` and `<uses-feature`, and use `enableHighAccuracy=false` when requesting location
48
+
49
+ :::note
50
+
42
51
  Read about [Setting Permissions](https://capacitorjs.com/docs/android/configuration#setting-permissions) in the [Android Guide](https://capacitorjs.com/docs/android) for more information on setting Android permissions.
43
52
 
44
53
 
@@ -173,7 +182,7 @@ Not available on web.
173
182
  | **`timeout`** | <code>number</code> | The maximum wait time in milliseconds for location updates. | <code>10000</code> | 1.0.0 |
174
183
  | **`maximumAge`** | <code>number</code> | The maximum age in milliseconds of a possible cached position that is acceptable to return | <code>0</code> | 1.0.0 |
175
184
  | **`minimumUpdateInterval`** | <code>number</code> | The minimum update interval for `watchPosition`. Not to be confused with `interval`. If location updates are available faster than this interval then an update will only occur if the minimum update interval has expired since the last location update. This parameter is only available for Android. It has no effect on iOS or Web platforms. | <code>5000</code> | 6.1.0 |
176
- | **`interval`** | <code>number</code> | Desired interval in milliseconds to receive location updates in `watchPosition`. For very low values of `interval` (a couple seconds or less), the platform may not guarantee timely location updates - they may take longer than specified. The platform may also be able to provide location updates faster than `interval`. You may use `minimumUpdateInterval` to control that behavior. For backwards compatiblity with version 7.1.x, if no value is passed, the default value of this parameter is that of `timeout`. This parameter is only available for Android. It has no effect on iOS or Web platforms. | <code>`timeout`</code> | 8.0.0 |
185
+ | **`interval`** | <code>number</code> | Desired interval in milliseconds to receive location updates in `watchPosition`. For very low values of `interval` (a couple seconds or less), the platform may not guarantee timely location updates - they may take longer than specified. The platform may also be able to provide location updates faster than `interval`. You may use `minimumUpdateInterval` to control that behavior. For backwards compatibility with version 7.1.x, if no value is passed, the default value of this parameter is that of `timeout`. This parameter is only available for Android. It has no effect on iOS or Web platforms. | <code>`timeout`</code> | 8.0.0 |
177
186
  | **`enableLocationFallback`** | <code>boolean</code> | Whether to fall back to the Android framework's `LocationManager` in case Google Play Service's location settings checks fail. This can happen for multiple reasons - e.g. device has no Play Services or device has no network connection (Airplane Mode) If set to `false`, failures are propagated to the caller. Note that `LocationManager` may not be as effective as Google Play Services implementation. If the device's in airplane mode, only the GPS provider is used, which may take longer to return a location, depending on GPS signal. This means that to receive location in such circumstances, you may need to provide a higher timeout. This parameter is only available for Android. It has no effect on iOS or Web platforms. | <code>true</code> | 8.0.0 |
178
187
 
179
188
 
@@ -247,3 +256,4 @@ The following table list all the plugin errors:
247
256
  | OS-PLUG-GLOC-0015 | Android | Google Play Services error. |
248
257
  | OS-PLUG-GLOC-0016 | Android | Location settings error. |
249
258
  | OS-PLUG-GLOC-0017 | Android | Unable to retrieve location because device has both Network and Location turned off. |
259
+ | OS-PLUG-GLOC-0018 | Android | Location permissions are not declared in manifest. Make sure at least ACCESS_COARSE_LOCATION is declared in AndroidManifest.xml, and optionally ACCESS_FINE_LOCATION if you require precise location access. |
@@ -81,7 +81,7 @@ dependencies {
81
81
  implementation project(':capacitor-android')
82
82
  }
83
83
 
84
- implementation("io.ionic.libs:iongeolocation-android:2.2.0")
84
+ implementation("io.ionic.libs:iongeolocation-android:2.2.1")
85
85
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
86
86
 
87
87
  implementation 'com.google.code.gson:gson:2.13.2'
@@ -73,4 +73,9 @@ object GeolocationErrors {
73
73
  code = formatErrorCode(17),
74
74
  message = "Unable to retrieve location because device has both Network and Location turned off."
75
75
  )
76
+
77
+ val LOCATION_MANIFEST_PERMISSIONS_MISSING = ErrorInfo(
78
+ code = formatErrorCode(18),
79
+ message = "Location permissions are not declared in manifest. Make sure at least ACCESS_COARSE_LOCATION is declared in AndroidManifest.xml, and optionally ACCESS_FINE_LOCATION if you require precise location access."
80
+ )
76
81
  }
@@ -11,7 +11,6 @@ import com.getcapacitor.PluginMethod
11
11
  import com.getcapacitor.annotation.CapacitorPlugin
12
12
  import com.getcapacitor.annotation.Permission
13
13
  import com.getcapacitor.annotation.PermissionCallback
14
- import com.google.android.gms.location.LocationServices
15
14
  import io.ionic.libs.iongeolocationlib.controller.IONGLOCController
16
15
  import io.ionic.libs.iongeolocationlib.model.IONGLOCException
17
16
  import io.ionic.libs.iongeolocationlib.model.IONGLOCLocationOptions
@@ -116,7 +115,10 @@ class GeolocationPlugin : Plugin() {
116
115
  callbackName: String,
117
116
  onPermissionGranted: () -> Unit
118
117
  ) {
119
- val alias = getAlias(call)
118
+ val alias = getAlias(call) ?: run {
119
+ call.sendError(GeolocationErrors.LOCATION_MANIFEST_PERMISSIONS_MISSING)
120
+ return
121
+ }
120
122
  if (getPermissionState(alias) != PermissionState.GRANTED) {
121
123
  requestPermissionForAlias(alias, call, callbackName)
122
124
  } else {
@@ -178,19 +180,20 @@ class GeolocationPlugin : Plugin() {
178
180
  }
179
181
 
180
182
  /**
181
- * Gets the appropriate permission alias
183
+ * Gets the appropriate permission alias, based on the Android version,
184
+ * the permissions declared in the manifest
185
+ * and the enableHighAccuracy option provided by the caller.
182
186
  * @param call the plugin call
183
- * @return String with correct alias
187
+ * @return String with correct alias or null if no permissions can be requested
184
188
  */
185
- private fun getAlias(call: PluginCall): String {
186
- var alias = LOCATION_ALIAS
187
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
188
- val enableHighAccuracy = call.getBoolean("enableHighAccuracy") ?: false
189
- if (!enableHighAccuracy) {
190
- alias = COARSE_LOCATION_ALIAS
191
- }
192
- }
193
- return alias
189
+ private fun getAlias(call: PluginCall): String? {
190
+ val hasFine = isPermissionDeclared(LOCATION_ALIAS)
191
+ val hasCoarse = isPermissionDeclared(COARSE_LOCATION_ALIAS)
192
+ if (!hasFine && !hasCoarse) return null
193
+ val enableHighAccuracy = call.getBoolean("enableHighAccuracy") ?: false
194
+ val shouldRequestFine =
195
+ hasFine && (Build.VERSION.SDK_INT < Build.VERSION_CODES.S || enableHighAccuracy)
196
+ return if (shouldRequestFine) LOCATION_ALIAS else COARSE_LOCATION_ALIAS
194
197
  }
195
198
 
196
199
  /**
@@ -316,7 +319,7 @@ class GeolocationPlugin : Plugin() {
316
319
  }
317
320
 
318
321
  /**
319
- * Extension function to return a unsuccessful plugin result
322
+ * Extension function to return an unsuccessful plugin result
320
323
  * @param error error class representing the error to return, containing a code and message
321
324
  */
322
325
  private fun PluginCall.sendError(error: GeolocationErrors.ErrorInfo) {
package/dist/docs.json CHANGED
@@ -243,7 +243,7 @@
243
243
  "name": "since"
244
244
  }
245
245
  ],
246
- "docs": "Desired interval in milliseconds to receive location updates in `watchPosition`.\n\nFor very low values of `interval` (a couple seconds or less),\nthe platform may not guarantee timely location updates - they may take longer than specified.\nThe platform may also be able to provide location updates faster than `interval`.\nYou may use `minimumUpdateInterval` to control that behavior.\n\nFor backwards compatiblity with version 7.1.x, if no value is passed,\nthe default value of this parameter is that of `timeout`.\n\nThis parameter is only available for Android. It has no effect on iOS or Web platforms.",
246
+ "docs": "Desired interval in milliseconds to receive location updates in `watchPosition`.\n\nFor very low values of `interval` (a couple seconds or less),\nthe platform may not guarantee timely location updates - they may take longer than specified.\nThe platform may also be able to provide location updates faster than `interval`.\nYou may use `minimumUpdateInterval` to control that behavior.\n\nFor backwards compatibility with version 7.1.x, if no value is passed,\nthe default value of this parameter is that of `timeout`.\n\nThis parameter is only available for Android. It has no effect on iOS or Web platforms.",
247
247
  "complexTypes": [],
248
248
  "type": "number | undefined"
249
249
  },
@@ -209,7 +209,7 @@ export interface PositionOptions {
209
209
  * The platform may also be able to provide location updates faster than `interval`.
210
210
  * You may use `minimumUpdateInterval` to control that behavior.
211
211
  *
212
- * For backwards compatiblity with version 7.1.x, if no value is passed,
212
+ * For backwards compatibility with version 7.1.x, if no value is passed,
213
213
  * the default value of this parameter is that of `timeout`.
214
214
  *
215
215
  * This parameter is only available for Android. It has no effect on iOS or Web platforms.
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PermissionState } from '@capacitor/core';\n\nexport type CallbackID = string;\n\nexport interface PermissionStatus {\n /**\n * Permission state for location alias.\n *\n * On Android it requests/checks both ACCESS_COARSE_LOCATION and\n * ACCESS_FINE_LOCATION permissions.\n *\n * On iOS and web it requests/checks location permission.\n *\n * @since 1.0.0\n */\n location: PermissionState;\n\n /**\n * Permission state for coarseLocation alias.\n *\n * On Android it requests/checks ACCESS_COARSE_LOCATION.\n *\n * On Android 12+, users can choose between Approximate location (ACCESS_COARSE_LOCATION) or\n * Precise location (ACCESS_FINE_LOCATION), so this alias can be used if the app doesn't\n * need high accuracy.\n *\n * On iOS and web it will have the same value as location alias.\n *\n * @since 1.2.0\n */\n coarseLocation: PermissionState;\n}\n\nexport type GeolocationPermissionType = 'location' | 'coarseLocation';\n\nexport interface GeolocationPluginPermissions {\n permissions: GeolocationPermissionType[];\n}\n\nexport interface GeolocationPlugin {\n /**\n * Get the current GPS location of the device\n *\n * @since 1.0.0\n */\n getCurrentPosition(options?: PositionOptions): Promise<Position>;\n\n /**\n * Set up a watch for location changes. Note that watching for location changes\n * can consume a large amount of energy. Be smart about listening only when you need to.\n *\n * @since 1.0.0\n */\n watchPosition(options: PositionOptions, callback: WatchPositionCallback): Promise<CallbackID>;\n\n /**\n * Clear a given watch\n *\n * @since 1.0.0\n */\n clearWatch(options: ClearWatchOptions): Promise<void>;\n\n /**\n * Check location permissions. Will throw if system location services are disabled.\n *\n * @since 1.0.0\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request location permissions. Will throw if system location services are disabled.\n *\n * Not available on web.\n *\n * @since 1.0.0\n */\n requestPermissions(permissions?: GeolocationPluginPermissions): Promise<PermissionStatus>;\n}\n\nexport interface ClearWatchOptions {\n id: CallbackID;\n}\n\nexport interface Position {\n /**\n * Creation timestamp for coords\n *\n * @since 1.0.0\n */\n timestamp: number;\n\n /**\n * The GPS coordinates along with the accuracy of the data\n *\n * @since 1.0.0\n */\n coords: {\n /**\n * Latitude in decimal degrees\n *\n * @since 1.0.0\n */\n latitude: number;\n\n /**\n * longitude in decimal degrees\n *\n * @since 1.0.0\n */\n longitude: number;\n\n /**\n * Accuracy level of the latitude and longitude coordinates in meters\n *\n * @since 1.0.0\n */\n accuracy: number;\n\n /**\n * Accuracy level of the altitude coordinate in meters, if available.\n *\n * Available on all iOS versions and on Android 8.0+.\n *\n * @since 1.0.0\n */\n altitudeAccuracy: number | null | undefined;\n\n /**\n * The altitude the user is at (if available)\n *\n * @since 1.0.0\n */\n altitude: number | null;\n\n /**\n * The speed the user is traveling (if available)\n *\n * @since 1.0.0\n */\n speed: number | null;\n\n /**\n * The heading the user is facing (if available).\n *\n * Historically, this field returned the direction of travel (course) on iOS and Android.\n * It now prioritizes the compass heading (true or magnetic) if available, falling back\n * to the direction of travel (course).\n *\n * @since 1.0.0\n */\n heading: number | null;\n\n /**\n * The heading (measured in degrees) relative to magnetic north.\n *\n * Only available when using `watchPosition`.\n *\n * @since 8.2.0\n */\n magneticHeading: number | null | undefined;\n\n /**\n * The heading (measured in degrees) relative to true north.\n *\n * Only available when using `watchPosition`.\n *\n * @since 8.2.0\n */\n trueHeading: number | null | undefined;\n\n /**\n * The maximum deviation (measured in degrees) between the reported heading and the true geomagnetic heading.\n *\n * Only available when using `watchPosition`.\n *\n * @since 8.2.0\n */\n headingAccuracy: number | null | undefined;\n\n /**\n * The direction in which the device is travelling, measured in degrees and relative to due north.\n *\n * Only available when using `watchPosition`.\n *\n * @since 8.2.0\n */\n course: number | null | undefined;\n };\n}\n\nexport interface PositionOptions {\n /**\n * High accuracy mode (such as GPS, if available)\n *\n * On Android 12+ devices it will be ignored if users didn't grant\n * ACCESS_FINE_LOCATION permissions (can be checked with location alias).\n *\n * @default false\n * @since 1.0.0\n */\n enableHighAccuracy?: boolean;\n\n /**\n * The maximum wait time in milliseconds for location updates.\n *\n * @default 10000\n * @since 1.0.0\n */\n timeout?: number;\n\n /**\n * The maximum age in milliseconds of a possible cached position that is acceptable to return\n *\n * @default 0\n * @since 1.0.0\n */\n maximumAge?: number;\n\n /**\n * The minimum update interval for `watchPosition`. Not to be confused with `interval`.\n *\n * If location updates are available faster than this interval then an update\n * will only occur if the minimum update interval has expired since the last location update.\n *\n * This parameter is only available for Android. It has no effect on iOS or Web platforms.\n *\n * @default 5000\n * @since 6.1.0\n */\n minimumUpdateInterval?: number;\n\n /**\n * Desired interval in milliseconds to receive location updates in `watchPosition`.\n *\n * For very low values of `interval` (a couple seconds or less),\n * the platform may not guarantee timely location updates - they may take longer than specified.\n * The platform may also be able to provide location updates faster than `interval`.\n * You may use `minimumUpdateInterval` to control that behavior.\n *\n * For backwards compatiblity with version 7.1.x, if no value is passed,\n * the default value of this parameter is that of `timeout`.\n *\n * This parameter is only available for Android. It has no effect on iOS or Web platforms.\n *\n * @default `timeout`\n * @since 8.0.0\n */\n interval?: number;\n\n /**\n * Whether to fall back to the Android framework's `LocationManager` in case Google Play Service's location settings checks fail.\n * This can happen for multiple reasons - e.g. device has no Play Services or device has no network connection (Airplane Mode)\n * If set to `false`, failures are propagated to the caller.\n * Note that `LocationManager` may not be as effective as Google Play Services implementation.\n * If the device's in airplane mode, only the GPS provider is used, which may take longer to return a location, depending on GPS signal.\n * This means that to receive location in such circumstances, you may need to provide a higher timeout.\n *\n * This parameter is only available for Android. It has no effect on iOS or Web platforms.\n *\n * @default true\n * @since 8.0.0\n */\n enableLocationFallback?: boolean;\n}\n\nexport type WatchPositionCallback = (position: Position | null, err?: any) => void;\n\n/**\n * @deprecated Use `PositionOptions`.\n * @since 1.0.0\n */\nexport type GeolocationOptions = PositionOptions;\n\n/**\n * @deprecated Use `WatchPositionCallback`.\n * @since 1.0.0\n */\nexport type GeolocationWatchCallback = WatchPositionCallback;\n\n/**\n * @deprecated Use `Position`.\n * @since 1.0.0\n */\nexport type GeolocationPosition = Position;\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PermissionState } from '@capacitor/core';\n\nexport type CallbackID = string;\n\nexport interface PermissionStatus {\n /**\n * Permission state for location alias.\n *\n * On Android it requests/checks both ACCESS_COARSE_LOCATION and\n * ACCESS_FINE_LOCATION permissions.\n *\n * On iOS and web it requests/checks location permission.\n *\n * @since 1.0.0\n */\n location: PermissionState;\n\n /**\n * Permission state for coarseLocation alias.\n *\n * On Android it requests/checks ACCESS_COARSE_LOCATION.\n *\n * On Android 12+, users can choose between Approximate location (ACCESS_COARSE_LOCATION) or\n * Precise location (ACCESS_FINE_LOCATION), so this alias can be used if the app doesn't\n * need high accuracy.\n *\n * On iOS and web it will have the same value as location alias.\n *\n * @since 1.2.0\n */\n coarseLocation: PermissionState;\n}\n\nexport type GeolocationPermissionType = 'location' | 'coarseLocation';\n\nexport interface GeolocationPluginPermissions {\n permissions: GeolocationPermissionType[];\n}\n\nexport interface GeolocationPlugin {\n /**\n * Get the current GPS location of the device\n *\n * @since 1.0.0\n */\n getCurrentPosition(options?: PositionOptions): Promise<Position>;\n\n /**\n * Set up a watch for location changes. Note that watching for location changes\n * can consume a large amount of energy. Be smart about listening only when you need to.\n *\n * @since 1.0.0\n */\n watchPosition(options: PositionOptions, callback: WatchPositionCallback): Promise<CallbackID>;\n\n /**\n * Clear a given watch\n *\n * @since 1.0.0\n */\n clearWatch(options: ClearWatchOptions): Promise<void>;\n\n /**\n * Check location permissions. Will throw if system location services are disabled.\n *\n * @since 1.0.0\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request location permissions. Will throw if system location services are disabled.\n *\n * Not available on web.\n *\n * @since 1.0.0\n */\n requestPermissions(permissions?: GeolocationPluginPermissions): Promise<PermissionStatus>;\n}\n\nexport interface ClearWatchOptions {\n id: CallbackID;\n}\n\nexport interface Position {\n /**\n * Creation timestamp for coords\n *\n * @since 1.0.0\n */\n timestamp: number;\n\n /**\n * The GPS coordinates along with the accuracy of the data\n *\n * @since 1.0.0\n */\n coords: {\n /**\n * Latitude in decimal degrees\n *\n * @since 1.0.0\n */\n latitude: number;\n\n /**\n * longitude in decimal degrees\n *\n * @since 1.0.0\n */\n longitude: number;\n\n /**\n * Accuracy level of the latitude and longitude coordinates in meters\n *\n * @since 1.0.0\n */\n accuracy: number;\n\n /**\n * Accuracy level of the altitude coordinate in meters, if available.\n *\n * Available on all iOS versions and on Android 8.0+.\n *\n * @since 1.0.0\n */\n altitudeAccuracy: number | null | undefined;\n\n /**\n * The altitude the user is at (if available)\n *\n * @since 1.0.0\n */\n altitude: number | null;\n\n /**\n * The speed the user is traveling (if available)\n *\n * @since 1.0.0\n */\n speed: number | null;\n\n /**\n * The heading the user is facing (if available).\n *\n * Historically, this field returned the direction of travel (course) on iOS and Android.\n * It now prioritizes the compass heading (true or magnetic) if available, falling back\n * to the direction of travel (course).\n *\n * @since 1.0.0\n */\n heading: number | null;\n\n /**\n * The heading (measured in degrees) relative to magnetic north.\n *\n * Only available when using `watchPosition`.\n *\n * @since 8.2.0\n */\n magneticHeading: number | null | undefined;\n\n /**\n * The heading (measured in degrees) relative to true north.\n *\n * Only available when using `watchPosition`.\n *\n * @since 8.2.0\n */\n trueHeading: number | null | undefined;\n\n /**\n * The maximum deviation (measured in degrees) between the reported heading and the true geomagnetic heading.\n *\n * Only available when using `watchPosition`.\n *\n * @since 8.2.0\n */\n headingAccuracy: number | null | undefined;\n\n /**\n * The direction in which the device is travelling, measured in degrees and relative to due north.\n *\n * Only available when using `watchPosition`.\n *\n * @since 8.2.0\n */\n course: number | null | undefined;\n };\n}\n\nexport interface PositionOptions {\n /**\n * High accuracy mode (such as GPS, if available)\n *\n * On Android 12+ devices it will be ignored if users didn't grant\n * ACCESS_FINE_LOCATION permissions (can be checked with location alias).\n *\n * @default false\n * @since 1.0.0\n */\n enableHighAccuracy?: boolean;\n\n /**\n * The maximum wait time in milliseconds for location updates.\n *\n * @default 10000\n * @since 1.0.0\n */\n timeout?: number;\n\n /**\n * The maximum age in milliseconds of a possible cached position that is acceptable to return\n *\n * @default 0\n * @since 1.0.0\n */\n maximumAge?: number;\n\n /**\n * The minimum update interval for `watchPosition`. Not to be confused with `interval`.\n *\n * If location updates are available faster than this interval then an update\n * will only occur if the minimum update interval has expired since the last location update.\n *\n * This parameter is only available for Android. It has no effect on iOS or Web platforms.\n *\n * @default 5000\n * @since 6.1.0\n */\n minimumUpdateInterval?: number;\n\n /**\n * Desired interval in milliseconds to receive location updates in `watchPosition`.\n *\n * For very low values of `interval` (a couple seconds or less),\n * the platform may not guarantee timely location updates - they may take longer than specified.\n * The platform may also be able to provide location updates faster than `interval`.\n * You may use `minimumUpdateInterval` to control that behavior.\n *\n * For backwards compatibility with version 7.1.x, if no value is passed,\n * the default value of this parameter is that of `timeout`.\n *\n * This parameter is only available for Android. It has no effect on iOS or Web platforms.\n *\n * @default `timeout`\n * @since 8.0.0\n */\n interval?: number;\n\n /**\n * Whether to fall back to the Android framework's `LocationManager` in case Google Play Service's location settings checks fail.\n * This can happen for multiple reasons - e.g. device has no Play Services or device has no network connection (Airplane Mode)\n * If set to `false`, failures are propagated to the caller.\n * Note that `LocationManager` may not be as effective as Google Play Services implementation.\n * If the device's in airplane mode, only the GPS provider is used, which may take longer to return a location, depending on GPS signal.\n * This means that to receive location in such circumstances, you may need to provide a higher timeout.\n *\n * This parameter is only available for Android. It has no effect on iOS or Web platforms.\n *\n * @default true\n * @since 8.0.0\n */\n enableLocationFallback?: boolean;\n}\n\nexport type WatchPositionCallback = (position: Position | null, err?: any) => void;\n\n/**\n * @deprecated Use `PositionOptions`.\n * @since 1.0.0\n */\nexport type GeolocationOptions = PositionOptions;\n\n/**\n * @deprecated Use `WatchPositionCallback`.\n * @since 1.0.0\n */\nexport type GeolocationWatchCallback = WatchPositionCallback;\n\n/**\n * @deprecated Use `Position`.\n * @since 1.0.0\n */\nexport type GeolocationPosition = Position;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/geolocation",
3
- "version": "8.2.0",
3
+ "version": "8.2.1-next.1",
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",