@capacitor/geolocation 8.2.1-next.1 → 8.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.
package/android/build.gradle
CHANGED
|
@@ -81,7 +81,7 @@ dependencies {
|
|
|
81
81
|
implementation project(':capacitor-android')
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
implementation("io.ionic.libs:iongeolocation-android:2.2.
|
|
84
|
+
implementation("io.ionic.libs:iongeolocation-android:2.2.2")
|
|
85
85
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
86
86
|
|
|
87
87
|
implementation 'com.google.code.gson:gson:2.13.2'
|
|
@@ -130,7 +130,8 @@ private extension GeolocationPlugin {
|
|
|
130
130
|
|
|
131
131
|
switch status {
|
|
132
132
|
case .denied:
|
|
133
|
-
self.
|
|
133
|
+
let error: GeolocationError = self.locationService?.areLocationServicesEnabled() == false ? .locationServicesDisabled : .permissionDenied
|
|
134
|
+
self.onLocationPermissionNotGranted(error: error)
|
|
134
135
|
case .notDetermined:
|
|
135
136
|
self.requestLocationAuthorisation(type: .whenInUse)
|
|
136
137
|
case .restricted:
|
|
@@ -149,6 +150,9 @@ private extension GeolocationPlugin {
|
|
|
149
150
|
locationCancellable = locationService?.currentLocationPublisher
|
|
150
151
|
.catch { [weak self] error -> AnyPublisher<IONGLOCPositionModel, Never> in
|
|
151
152
|
print("An error was found while retrieving the location: \(error)")
|
|
153
|
+
// A failure terminates this subscription; re-bind or later callbacks are dropped. RMET-5383
|
|
154
|
+
self?.locationInitialized = false
|
|
155
|
+
self?.bindLocationPublisher()
|
|
152
156
|
|
|
153
157
|
if case IONGLOCLocationError.locationUnavailable = error {
|
|
154
158
|
print("Location unavailable (likely due to backgrounding). Keeping watch callbacks alive.")
|
|
@@ -233,7 +237,12 @@ private extension GeolocationPlugin {
|
|
|
233
237
|
|
|
234
238
|
switch locationService?.authorisationStatus {
|
|
235
239
|
case .authorisedAlways, .authorisedWhenInUse: onLocationPermissionGranted()
|
|
236
|
-
case .denied:
|
|
240
|
+
case .denied:
|
|
241
|
+
if locationService?.areLocationServicesEnabled() == false {
|
|
242
|
+
callbackManager?.sendError(.locationServicesDisabled)
|
|
243
|
+
} else {
|
|
244
|
+
callbackManager?.sendError(.permissionDenied)
|
|
245
|
+
}
|
|
237
246
|
case .restricted: callbackManager?.sendError(.permissionRestricted)
|
|
238
247
|
default: break
|
|
239
248
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/geolocation",
|
|
3
|
-
"version": "8.2.1
|
|
3
|
+
"version": "8.2.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",
|