@capacitor/geolocation 8.0.0 → 8.1.0
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/CapacitorGeolocation.podspec +1 -1
- package/README.md +1 -1
- package/android/build.gradle +23 -2
- package/dist/docs.json +1 -1
- package/dist/esm/definitions.d.ts +1 -1
- package/dist/esm/definitions.js.map +1 -1
- package/package.json +4 -3
|
@@ -9,7 +9,7 @@ Pod::Spec.new do |s|
|
|
|
9
9
|
s.license = package['license']
|
|
10
10
|
s.homepage = package['repository']['url']
|
|
11
11
|
s.author = package['author']
|
|
12
|
-
s.source = { :git => package['repository']['url'], :tag => s.version
|
|
12
|
+
s.source = { :git => package['repository']['url'], :tag => "v#{s.version}" }
|
|
13
13
|
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
14
|
s.ios.deployment_target = '15.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
package/README.md
CHANGED
|
@@ -172,7 +172,7 @@ Not available on web.
|
|
|
172
172
|
| **`enableHighAccuracy`** | <code>boolean</code> | High accuracy mode (such as GPS, if available) On Android 12+ devices it will be ignored if users didn't grant ACCESS_FINE_LOCATION permissions (can be checked with location alias). | <code>false</code> | 1.0.0 |
|
|
173
173
|
| **`timeout`** | <code>number</code> | The maximum wait time in milliseconds for location updates. | <code>10000</code> | 1.0.0 |
|
|
174
174
|
| **`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
|
-
| **`minimumUpdateInterval`** | <code>number</code> | The
|
|
175
|
+
| **`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
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 |
|
|
177
177
|
| **`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
178
|
|
package/android/build.gradle
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
ext {
|
|
2
|
+
capacitorVersion = System.getenv('CAPACITOR_VERSION')
|
|
2
3
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
4
|
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
|
|
4
5
|
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
|
|
@@ -12,15 +13,26 @@ buildscript {
|
|
|
12
13
|
repositories {
|
|
13
14
|
google()
|
|
14
15
|
mavenCentral()
|
|
16
|
+
maven {
|
|
17
|
+
url = "https://plugins.gradle.org/m2/"
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
dependencies {
|
|
17
21
|
classpath 'com.android.tools.build:gradle:8.13.0'
|
|
18
22
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
23
|
+
if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
24
|
+
classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
|
|
25
|
+
}
|
|
19
26
|
}
|
|
20
27
|
}
|
|
21
28
|
|
|
22
29
|
apply plugin: 'com.android.library'
|
|
23
30
|
apply plugin: 'kotlin-android'
|
|
31
|
+
if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
32
|
+
apply plugin: 'io.github.gradle-nexus.publish-plugin'
|
|
33
|
+
apply from: file('../scripts/android/publish-root.gradle')
|
|
34
|
+
apply from: file('../scripts/android/publish-module.gradle')
|
|
35
|
+
}
|
|
24
36
|
|
|
25
37
|
android {
|
|
26
38
|
namespace = "com.capacitorjs.plugins.geolocation"
|
|
@@ -35,7 +47,7 @@ android {
|
|
|
35
47
|
buildTypes {
|
|
36
48
|
release {
|
|
37
49
|
minifyEnabled false
|
|
38
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
50
|
+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
39
51
|
}
|
|
40
52
|
}
|
|
41
53
|
lintOptions {
|
|
@@ -45,6 +57,9 @@ android {
|
|
|
45
57
|
sourceCompatibility JavaVersion.VERSION_21
|
|
46
58
|
targetCompatibility JavaVersion.VERSION_21
|
|
47
59
|
}
|
|
60
|
+
publishing {
|
|
61
|
+
singleVariant("release")
|
|
62
|
+
}
|
|
48
63
|
}
|
|
49
64
|
|
|
50
65
|
kotlin {
|
|
@@ -59,8 +74,14 @@ repositories {
|
|
|
59
74
|
|
|
60
75
|
dependencies {
|
|
61
76
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
77
|
+
|
|
78
|
+
if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
79
|
+
implementation "com.capacitorjs:core:$capacitorVersion"
|
|
80
|
+
} else {
|
|
81
|
+
implementation project(':capacitor-android')
|
|
82
|
+
}
|
|
83
|
+
|
|
62
84
|
implementation("io.ionic.libs:iongeolocation-android:2.1.0")
|
|
63
|
-
implementation project(':capacitor-android')
|
|
64
85
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
65
86
|
|
|
66
87
|
implementation 'com.google.code.gson:gson:2.13.2'
|
package/dist/docs.json
CHANGED
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
"name": "since"
|
|
228
228
|
}
|
|
229
229
|
],
|
|
230
|
-
"docs": "The
|
|
230
|
+
"docs": "The minimum update interval for `watchPosition`. Not to be confused with `interval`.\n\nIf location updates are available faster than this interval then an update\nwill only occur if the minimum update interval has expired since the last location update.\n\nThis parameter is only available for Android. It has no effect on iOS or Web platforms.",
|
|
231
231
|
"complexTypes": [],
|
|
232
232
|
"type": "number | undefined"
|
|
233
233
|
},
|
|
@@ -154,7 +154,7 @@ export interface PositionOptions {
|
|
|
154
154
|
*/
|
|
155
155
|
maximumAge?: number;
|
|
156
156
|
/**
|
|
157
|
-
* The
|
|
157
|
+
* The minimum update interval for `watchPosition`. Not to be confused with `interval`.
|
|
158
158
|
*
|
|
159
159
|
* If location updates are available faster than this interval then an update
|
|
160
160
|
* will only occur if the minimum update interval has expired since the last location update.
|
|
@@ -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 * @since 1.0.0\n */\n heading: number | null;\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
|
|
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 * @since 1.0.0\n */\n heading: number | null;\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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/geolocation",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.0",
|
|
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",
|
|
@@ -39,11 +39,12 @@
|
|
|
39
39
|
"eslint": "eslint . --ext ts",
|
|
40
40
|
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
41
41
|
"swiftlint": "node-swiftlint",
|
|
42
|
-
"docgen": "docgen --api GeolocationPlugin --output-readme README.md --output-json dist/docs.json
|
|
42
|
+
"docgen": "docgen --api GeolocationPlugin --output-readme README.md --output-json dist/docs.json",
|
|
43
43
|
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
44
44
|
"clean": "rimraf ./dist",
|
|
45
45
|
"watch": "tsc --watch",
|
|
46
|
-
"prepublishOnly": "npm run build"
|
|
46
|
+
"prepublishOnly": "npm run build",
|
|
47
|
+
"publish:cocoapod": "pod trunk push ./CapacitorGeolocation.podspec --allow-warnings"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
50
|
"@capacitor/synapse": "^1.0.4"
|