@josuelmm/cordova-background-geolocation 4.2.3 → 4.5.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.
Files changed (103) hide show
  1. package/.npmignore +11 -0
  2. package/CHANGELOG.md +261 -0
  3. package/README.md +306 -115
  4. package/android/CDVBackgroundGeolocation/src/main/java/com/marianhello/bgloc/cordova/ConfigMapper.java +34 -0
  5. package/android/CDVBackgroundGeolocation/src/main/java/com/tenforwardconsulting/bgloc/cordova/BackgroundGeolocationPlugin.java +61 -1
  6. package/android/common/src/main/AndroidManifest.xml +1 -1
  7. package/android/common/src/main/java/com/marianhello/bgloc/BootCompletedReceiver.java +20 -3
  8. package/android/common/src/main/java/com/marianhello/bgloc/Config.java +87 -1
  9. package/android/common/src/main/java/com/marianhello/bgloc/data/BackgroundLocation.java +94 -0
  10. package/android/common/src/main/java/com/marianhello/bgloc/data/ConfigJsonMapper.java +211 -0
  11. package/android/common/src/main/java/com/marianhello/bgloc/data/LocationTemplateFactory.java +6 -0
  12. package/android/common/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteConfigurationContract.java +5 -1
  13. package/android/common/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteConfigurationDAO.java +32 -1
  14. package/android/common/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteLocationContract.java +12 -2
  15. package/android/common/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteLocationDAO.java +33 -2
  16. package/android/common/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteOpenHelper.java +15 -1
  17. package/android/common/src/main/java/com/marianhello/bgloc/provider/AbstractLocationProvider.java +48 -1
  18. package/android/common/src/main/java/com/marianhello/bgloc/provider/ActivityRecognitionLocationProvider.java +105 -6
  19. package/android/common/src/main/java/com/marianhello/bgloc/provider/DistanceFilterLocationProvider.java +336 -250
  20. package/android/common/src/main/java/com/marianhello/bgloc/provider/RawLocationProvider.java +69 -19
  21. package/android/common/src/main/java/com/marianhello/bgloc/service/LocationServiceImpl.java +246 -21
  22. package/android/common/src/main/java/com/marianhello/bgloc/service/LocationServiceProxy.java +5 -2
  23. package/android/common/src/main/java/com/marianhello/bgloc/sync/BatchManager.java +46 -13
  24. package/ios/CDVBackgroundGeolocation/CDVBackgroundGeolocation.m +23 -1
  25. package/ios/common/BackgroundGeolocation/MAURActivityLocationProvider.m +208 -70
  26. package/ios/common/BackgroundGeolocation/MAURBackgroundGeolocationFacade.m +132 -5
  27. package/ios/common/BackgroundGeolocation/MAURBackgroundSync.m +20 -0
  28. package/ios/common/BackgroundGeolocation/MAURConfig.h +7 -0
  29. package/ios/common/BackgroundGeolocation/MAURConfig.m +37 -2
  30. package/ios/common/BackgroundGeolocation/MAURConfigurationContract.h +3 -0
  31. package/ios/common/BackgroundGeolocation/MAURConfigurationContract.m +3 -1
  32. package/ios/common/BackgroundGeolocation/MAURDistanceFilterLocationProvider.m +10 -1
  33. package/ios/common/BackgroundGeolocation/MAURGeolocationOpenHelper.m +15 -1
  34. package/ios/common/BackgroundGeolocation/MAURLocation.h +12 -0
  35. package/ios/common/BackgroundGeolocation/MAURLocation.m +33 -4
  36. package/ios/common/BackgroundGeolocation/MAURLocationContract.h +4 -0
  37. package/ios/common/BackgroundGeolocation/MAURLocationContract.m +5 -1
  38. package/ios/common/BackgroundGeolocation/MAURLocationManager.m +19 -1
  39. package/ios/common/BackgroundGeolocation/MAURPostLocationTask.h +9 -0
  40. package/ios/common/BackgroundGeolocation/MAURPostLocationTask.m +59 -1
  41. package/ios/common/BackgroundGeolocation/MAURRawLocationProvider.m +10 -1
  42. package/ios/common/BackgroundGeolocation/MAURSQLiteConfigurationDAO.m +54 -4
  43. package/ios/common/BackgroundGeolocation/MAURSQLiteLocationDAO.h +12 -0
  44. package/ios/common/BackgroundGeolocation/MAURSQLiteLocationDAO.m +125 -5
  45. package/package.json +31 -1
  46. package/plugin.xml +3 -10
  47. package/www/BackgroundGeolocation.d.ts +143 -3
  48. package/www/BackgroundGeolocation.js +11 -4
  49. package/CLAUDE.md +0 -56
  50. package/HISTORY.md +0 -871
  51. package/android/CDVBackgroundGeolocation/src/test/java/com/marianhello/ConfigMapperTest.java +0 -220
  52. package/android/common/src/androidTest/java/com/marianhello/bgloc/BackgroundGeolocationFacadeTest.java +0 -45
  53. package/android/common/src/androidTest/java/com/marianhello/bgloc/BatchManagerTest.java +0 -570
  54. package/android/common/src/androidTest/java/com/marianhello/bgloc/ConfigTest.java +0 -76
  55. package/android/common/src/androidTest/java/com/marianhello/bgloc/ContentProviderLocationDAOTest.java +0 -437
  56. package/android/common/src/androidTest/java/com/marianhello/bgloc/DBLogReaderTest.java +0 -95
  57. package/android/common/src/androidTest/java/com/marianhello/bgloc/LocationContentProviderTest.java +0 -159
  58. package/android/common/src/androidTest/java/com/marianhello/bgloc/LocationServiceProxyTest.java +0 -161
  59. package/android/common/src/androidTest/java/com/marianhello/bgloc/LocationServiceTest.java +0 -247
  60. package/android/common/src/androidTest/java/com/marianhello/bgloc/SQLiteConfigurationDAOTest.java +0 -200
  61. package/android/common/src/androidTest/java/com/marianhello/bgloc/SQLiteLocationDAOTest.java +0 -457
  62. package/android/common/src/androidTest/java/com/marianhello/bgloc/SQLiteLocationDAOThreadTest.java +0 -96
  63. package/android/common/src/androidTest/java/com/marianhello/bgloc/SQLiteOpenHelperTest.java +0 -225
  64. package/android/common/src/androidTest/java/com/marianhello/bgloc/TestPluginDelegate.java +0 -46
  65. package/android/common/src/androidTest/java/com/marianhello/bgloc/TestResourceResolver.java +0 -14
  66. package/android/common/src/androidTest/java/com/marianhello/bgloc/provider/MockLocationProvider.java +0 -50
  67. package/android/common/src/androidTest/java/com/marianhello/bgloc/provider/TestLocationProviderFactory.java +0 -17
  68. package/android/common/src/androidTest/java/com/marianhello/bgloc/sqlite/SQLiteOpenHelper10.java +0 -92
  69. package/android/common/src/androidTest/java/com/marianhello/bgloc/test/LocationProviderTestCase.java +0 -107
  70. package/android/common/src/androidTest/java/com/marianhello/bgloc/test/TestConstants.java +0 -5
  71. package/android/common/src/test/java/com/marianhello/backgroundgeolocation/ArrayListLocationTemplateTest.java +0 -82
  72. package/android/common/src/test/java/com/marianhello/backgroundgeolocation/BackgroundLocationTest.java +0 -128
  73. package/android/common/src/test/java/com/marianhello/backgroundgeolocation/ConfigTest.java +0 -191
  74. package/android/common/src/test/java/com/marianhello/backgroundgeolocation/DBLogReaderTest.java +0 -37
  75. package/android/common/src/test/java/com/marianhello/backgroundgeolocation/HashMapLocationTemplateTest.java +0 -216
  76. package/android/common/src/test/java/com/marianhello/backgroundgeolocation/HttpPostServiceTest.java +0 -223
  77. package/android/common/src/test/java/com/marianhello/backgroundgeolocation/LocationTemplateFactoryTest.java +0 -50
  78. package/android/common/src/test/java/com/marianhello/backgroundgeolocation/PostLocationTaskTest.java +0 -180
  79. package/android/common/src/test/java/com/marianhello/backgroundgeolocation/TestHelper.java +0 -16
  80. package/ios/common/BackgroundGeolocation/SOMotionDetector/CHANGELOG.md +0 -2
  81. package/ios/common/BackgroundGeolocation/SOMotionDetector/LICENSE +0 -21
  82. package/ios/common/BackgroundGeolocation/SOMotionDetector/README.md +0 -135
  83. package/ios/common/BackgroundGeolocation/SOMotionDetector/SOLocationManager.h +0 -80
  84. package/ios/common/BackgroundGeolocation/SOMotionDetector/SOLocationManager.m +0 -147
  85. package/ios/common/BackgroundGeolocation/SOMotionDetector/SOMotionActivity.h +0 -30
  86. package/ios/common/BackgroundGeolocation/SOMotionDetector/SOMotionActivity.m +0 -42
  87. package/ios/common/BackgroundGeolocation/SOMotionDetector/SOMotionDetector.h +0 -99
  88. package/ios/common/BackgroundGeolocation/SOMotionDetector/SOMotionDetector.m +0 -327
  89. package/ios/common/BackgroundGeolocation/SOMotionDetector/SOStepDetector.h +0 -44
  90. package/ios/common/BackgroundGeolocation/SOMotionDetector/SOStepDetector.m +0 -94
  91. package/ios/common/BackgroundGeolocationTests/Info.plist +0 -24
  92. package/ios/common/BackgroundGeolocationTests/MAURBackgroundLocationTest.m +0 -185
  93. package/ios/common/BackgroundGeolocationTests/MAURConfigTest.m +0 -161
  94. package/ios/common/BackgroundGeolocationTests/MAURGeolocationOpenHelperTest.m +0 -102
  95. package/ios/common/BackgroundGeolocationTests/MAURLocationTest.m +0 -216
  96. package/ios/common/BackgroundGeolocationTests/MAURLocationUploaderTest.m +0 -55
  97. package/ios/common/BackgroundGeolocationTests/MAURLogReaderTest.m +0 -43
  98. package/ios/common/BackgroundGeolocationTests/MAURSQLiteConfigurationDAOTest.m +0 -102
  99. package/ios/common/BackgroundGeolocationTests/MAURSQLiteHelperTest.m +0 -41
  100. package/ios/common/BackgroundGeolocationTests/MAURSQLiteLocationDAOTests.m +0 -240
  101. package/ios/common/BackgroundGeolocationTests/MAURSQLiteLocationDAOThreadTest.m +0 -84
  102. package/ios/common/BackgroundGeolocationTests/MAURSQLiteOpenHelperTest.m +0 -144
  103. package/ios/common/scripts/xcode-refactor.js +0 -184
package/HISTORY.md DELETED
@@ -1,871 +0,0 @@
1
- # Historical Changelog
2
-
3
- **for cordova-plugin-background-geolocation**
4
-
5
- ## [4.2.3] - 2026-05-09
6
-
7
- ### Fixed
8
- - `PostLocationTask` debug log: missing `mode` argument for the 4-placeholder format string. Cosmetic.
9
- - Plugin version: `4.2.3`.
10
-
11
- ## [4.2.2] - 2026-05-09
12
-
13
- ### Fixed
14
- - `PostLocationTask`: handle `LocationTemplate.locationToJson` returning `Object` (JSONObject vs JSONArray) — fixed compile failure under Capacitor / Gradle 8.x.
15
- - `BackgroundGeolocationPlugin.buildDiagnostics`: wrap `facade.locationServicesEnabled()` in `try/catch (PluginException)` — fixed unreported-checked-exception build error.
16
- - Plugin version: `4.2.2`.
17
-
18
- ## [4.2.0] - 2026-05-08
19
-
20
- ### Phase 8 — Real sensor fusion (accelerometer + gyroscope)
21
-
22
- - New Android `com.marianhello.bgloc.sensor.SensorFusionDetector` using `Sensor.TYPE_LINEAR_ACCELERATION` + `Sensor.TYPE_GYROSCOPE` at `SENSOR_DELAY_GAME`.
23
- - New iOS `MAURSensorFusionDetector` using `CMMotionManager.startDeviceMotionUpdatesToQueue` (50 Hz).
24
- - New `drivingEvents.sensorFusion` toggle (off by default) plus thresholds: `crashImpactG` (default 3.0), `sensorCrashCooldownMs`, `phoneUsageWindowMs`, `phoneUsageCooldownMs`.
25
- - `possibleCrash` event payload extended with `source: "gps" | "sensor"`.
26
- - New `phoneUsageWhileDriving` event (jitter + screen-on during active trip).
27
- - Hot-reload of sensor pipeline on `configure()`.
28
- - Plugin version: `4.2.0`.
29
-
30
- ## [4.1.0] - 2026-05-09
31
-
32
- ### Phase 6.1 — GPS-derived sensor-like driving events
33
-
34
- - New events: `hardBrake`, `rapidAcceleration`, `sharpTurn`, `possibleCrash` (all GPS-derived, no accelerometer/gyroscope yet).
35
- - New config thresholds: `hardBrakeMps2`, `rapidAccelMps2`, `sharpTurnDegPerSec`, `crashImpactKmh`, `crashWindowMs`. Set any to 0 to disable.
36
- - 4-second cooldown per event to avoid refiring on sustained conditions.
37
- - Android `DrivingEventsDetector` extended; iOS detector inline in `MAURBackgroundGeolocationFacade`. Same heuristics on both platforms.
38
- - 4 new MSG codes (120-123) and 4 new NSNotifications wired end-to-end to JS.
39
- - Plugin version: `4.1.0`.
40
-
41
- Sensor fusion (real accelerometer + gyroscope) deferred to v4.2 as a separate `SensorFusionDetector` class.
42
-
43
- ## [4.0.0] - 2026-05-08
44
-
45
- ### Phase 6 — Driver insights (GPS-only)
46
-
47
- - New events: `tripStart`, `tripEnd` (with `distance` + `durationMs`), `moving`, `stopped`, `speeding`, `providerChange`, `sos`.
48
- - New method: `triggerSOS(payload?)`. New config: `drivingEvents` with thresholds for moving / trip / speed limit.
49
- - Shared state machine: Android `DrivingEventsDetector.java` (pure-Java); iOS inline in `MAURBackgroundGeolocationFacade`. Android uses MSG codes 113-119 routed via the existing `PluginDelegate`; iOS uses 7 new `NSNotification`s observed in `CDVBackgroundGeolocation`.
50
- - TypeScript: 7 new event overloads, new method declaration, new config option.
51
- - Plugin version: `4.0.0`.
52
-
53
- ### Sensor-fusion events deferred to v4.1
54
- - `hardBrake`, `rapidAcceleration`, `sharpTurn`, `possibleCrash` require accelerometer + gyroscope. Excluded on purpose to keep v4.0.0 GPS-only and reliable.
55
-
56
- ## [3.6.0] - 2026-05-08
57
-
58
- ### Phase 5 — Battery / OEM helpers
59
-
60
- - Added `isIgnoringBatteryOptimizations()`, `requestIgnoreBatteryOptimizations()`, `openBatterySettings()`, `openAutoStartSettings()`, `getManufacturerHelp()` (Android + iOS).
61
- - Android helper class `com.marianhello.bgloc.oem.BatteryOemHelper` with per-OEM `ComponentName` table for auto-start screens (Xiaomi MIUI, Huawei EMUI, Oppo ColorOS, Vivo FunTouch, OnePlus, Asus; Samsung falls back to app-info).
62
- - iOS uses `UIApplicationOpenSettingsURLString` as best-effort destination and reports `manufacturer: 'apple'`.
63
- - Angular service re-exports the 5 new helpers with strong types.
64
-
65
- ## [3.5.0] - 2026-05-08
66
-
67
- ### Phase 4 — Diagnostics
68
-
69
- - Added `getDiagnostics()` (Android + iOS) returning permissions, battery whitelist state, OEM manufacturer, last fix age, pending sync count, foreground service type (Android) and precise location / background refresh / low power / motion permission (iOS).
70
- - Added `Diagnostics` TypeScript interface in `www/BackgroundGeolocation.d.ts`.
71
- - Angular service exposes `getDiagnostics()`.
72
- - Android plugin version bumped to `3.5.0`.
73
-
74
- - Added `mockLocationPolicy: 'allow' | 'flag' | 'drop'` config (Android `Config` + iOS `MAURConfig`). Applied in `PostLocationTask` (Android) and `MAURPostLocationTask` (iOS): mocked samples are dropped before persistence when policy is `'drop'`.
75
- - Added `heartbeatInterval` config option (typed in `.d.ts`, persisted in `Config` / `MAURConfig`).
76
- - Registered events `heartbeat`, `syncStart`, `syncProgress`, `syncSuccess`, `syncError` in `www/BackgroundGeolocation.js` and both `Event` union and `BackgroundGeolocationEvents` enum in `.d.ts`.
77
- - **Sync events emit natively now**: Android via `MSG_ON_SYNC_*` broadcasts from `SyncAdapter` → `BackgroundGeolocationFacade` → `PluginDelegate` → `BackgroundGeolocationPlugin.sendEvent`; iOS via `NSNotificationCenter` from `MAURBackgroundSync` → `CDVBackgroundGeolocation` observers. `syncSuccess` payload includes `sent`; `syncError` payload includes `httpStatus` + `message`.
78
- - Bug: iOS `getPluginVersion` returned hardcoded `"3.2.0"`; now `"3.5.0"`.
79
-
80
- - `syncProgress` emits natively now: Android via `MSG_ON_SYNC_PROGRESS` from `SyncAdapter.onProgress`; iOS via `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:` posting `MAURBackgroundSyncDidProgressNotification`. Both are forwarded as `syncProgress` JS events.
81
- - TypeScript `on()` overloads added for `'heartbeat'`, `'syncStart'`, `'syncProgress'`, `'syncSuccess'`, `'syncError'` so string-literal subscriptions type-check.
82
- - Bug: iOS `MAURBackgroundSync.tasks` was never allocated. Fixed in `init`.
83
-
84
- - `heartbeat` emits natively now: Android `LocationServiceImpl` schedules a `ScheduledExecutorService` task on service start using `Config.heartbeatInterval`, broadcasts `MSG_ON_HEARTBEAT` with the latest `BackgroundLocation`, and `BackgroundGeolocationPlugin` forwards it to JS. iOS `MAURBackgroundGeolocationFacade` schedules an `NSTimer` (main run loop), posts `MAURHeartbeatNotification`, and `CDVBackgroundGeolocation` forwards it as a `heartbeat` JS event with the latest location.
85
-
86
- Phase 4 status: all four deliverables (`getDiagnostics`, `mockLocationPolicy`, sync events, heartbeat) are now native and end-to-end.
87
-
88
- ## [3.4.0] - 2026-05-08
89
-
90
- ### Phase 3 — Location API modernization
91
-
92
- - Android `ActivityRecognitionLocationProvider`: `LocationRequest.Builder` + `Priority.PRIORITY_*` (replaces deprecated `LocationRequest.create()`, `setPriority/setInterval/setFastestInterval`, `LocationRequest.PRIORITY_*`).
93
- - Android `RawLocationProvider`: removed `Criteria` and `getBestProvider`; explicit GPS-first / Network-fallback selection.
94
- - `plugin.xml`: `GOOGLE_PLAY_SERVICES_VERSION` default raised to `21.0.1`.
95
- - iOS `MAURPostLocationTask`: `NSURLConnection` (deprecated iOS 9) replaced with `NSURLSession dataTaskWithRequest:` + `dispatch_semaphore` for the synchronous post path.
96
- - iOS `MAURDistanceFilterLocationProvider`: added `locationManagerDidChangeAuthorization:` (iOS 14+) alongside the legacy callback; short-circuit legacy on iOS 14+ to avoid double notifications.
97
- - iOS `MAURConfig` + `MAURDistanceFilterLocationProvider`: new `showsBackgroundLocationIndicator` config (iOS 11+).
98
- - TypeScript: `showsBackgroundLocationIndicator?: boolean` added to `ConfigureOptions`.
99
- - `cordova-ios >= 6.2.0` required for `3.4.0` (runtime `@available` checks gate iOS 11/14 APIs).
100
-
101
- - Android `DistanceFilterLocationProvider`: `Criteria` API fully removed; `getBestProvider(criteria, true)` replaced by explicit `pickProvider()`; `requestSingleUpdate(criteria, ...)` replaced by the provider-string overload.
102
- - Bug: iOS `activitiesInterval` parsing in `MAURConfig.fromDictionary` had inverted `isNull` check; fixed.
103
- - Bug: Android `Content-Length` used `String.length()` (chars) instead of UTF-8 byte length; fixed in `HttpPostService.postJSONString`.
104
-
105
- Notes (still legacy but functional):
106
- - `LocationManager.getLastKnownLocation` kept (not deprecated).
107
- - `LocationManager.requestSingleUpdate(String, PendingIntent)` kept (modern `getCurrentLocation` does not accept `PendingIntent`).
108
- - `AlarmManager.setInexactRepeating` kept for stationary polling; planned FGS-driven replacement.
109
-
110
- ## [3.3.0] - 2026-05-07
111
-
112
- ### Phase 2 — Backend-agnostic HTTP transport
113
-
114
- - Added: `httpMethod`, `syncHttpMethod` (`POST` default, also `GET`, `PUT`, `PATCH`).
115
- - Added: `httpMode`, `syncMode` (`batch` default, `single` for one request per location). `single` is required with `GET`.
116
- - Added: URL templating with placeholders `{latitude}`, `{longitude}`, `{lat}`, `{lon}`, `{time}`, `{timestamp}`, `{timestamp_iso}`, `{speed}`, `{altitude}`, `{bearing}`, `{accuracy}`, `{provider}` plus any keys from `queryParams`.
117
- - Added: `queryParams`, `headers` (alias of `httpHeaders`), `bodyTemplate` (alias of `postTemplate`).
118
- - Added: helpers `com.marianhello.bgloc.http.UrlTemplateResolver` (Android) and `MAURUrlTemplateResolver` (iOS).
119
- - Changed: `HttpPostService` (Android), `MAURPostLocationTask` and `MAURBackgroundSync` (iOS) no longer hardcode POST.
120
- - Compatibility: existing apps using only `url` + `httpHeaders` + `postTemplate` keep working.
121
-
122
- ### Phase 1 — Auto-start Android
123
-
124
- - Added: `ACCESS_BACKGROUND_LOCATION` permission, validated at runtime on Android 10+ before starting the foreground service.
125
- - Added: boot receiver also handles `QUICKBOOT_POWERON` (HTC, MIUI), `com.htc.intent.action.QUICKBOOT_POWERON`, and `MY_PACKAGE_REPLACED` (service is relaunched after app updates).
126
- - Added: `ForegroundServiceStartNotAllowedException` (Android 12+) is now caught with clear logging in `BootCompletedReceiver` and `LocationServiceProxy`. WorkManager is not used as a tracking fallback (only for deferred sync).
127
- - Changed: `foregroundServiceType` simplified to `"location"`; `LocationServiceImpl.startForeground()` reads the type dynamically from the manifest instead of hardcoding `0x8`.
128
- - Changed: `LocationServiceProxy.startForegroundService()` no longer falls back to `startService()` when location permission is missing — it logs and exits.
129
- - Changed: `engines` raised to `cordova >= 10.0.0` and `cordova-android >= 12.0.0`.
130
- - Removed: `FOREGROUND_SERVICE_DATA_SYNC` permission and `dataSync` from `foregroundServiceType`.
131
- - Removed: `<uses-library org.apache.http.legacy>` and `useLibrary 'org.apache.http.legacy'` (no longer used; the plugin uses `HttpURLConnection`).
132
- - Removed: dead constant `FOREGROUND_SERVICE_TYPE_LOCATION = 4` in `LocationServiceImpl.java` (incorrect value; never referenced).
133
- - Build: `jcenter()` → `mavenCentral()` in `android/build.gradle`.
134
- - Docs: planning docs `docs/auto-start.md`, `docs/http-transport.md`, `docs/traccar.md`, `docs/driving-events.md`, `docs/ROADMAP.md`, `docs/location-modernization.md` (Fase 3 / v3.4). Audit in `REVIEW_3.2.0.md` (§8–§9 alineados al roadmap vigente).
135
-
136
- ## [3.2.0] - 2026-02-28
137
-
138
- ### Added
139
-
140
- - **Session API (route/recording):** `startSession()`, `getSessionLocations()`, `clearSession()`, `getSessionLocationsCount()`. Separate session table (Android DB v20, iOS DB v5) so the app can restore the full route when reopening without internet. Session is cleared on `startSession()` and `clearSession()`; not cleared when sync succeeds.
141
-
142
- ## [3.1.0] - 2019-09-24
143
-
144
- ### Fixed
145
-
146
- - fix package scope
147
- - Android fix RejectedExecutionException
148
- - Android add stop guard
149
-
150
- ## Changed
151
-
152
- - adopt headless task changes in common module
153
-
154
- ### [3.0.7] - 2019-09-17
155
-
156
- ### Fixed
157
-
158
- - Android Foreground service permission is required since Android 28 - @IsraelHikingMap
159
-
160
- ### [3.0.6] - 2019-08-27
161
-
162
- ### Fixed
163
-
164
- - Android allow to start service from background on API >=26
165
-
166
- ### [3.0.5] - 2019-08-13
167
-
168
- ### Fixed
169
-
170
- - Android fix tone generator crash
171
- - Fixed XML config to use to install plugin (PR #575) - @globules-io
172
- - Fixed typo in README - @diegogurpegui
173
-
174
- Many thanks to all contributors
175
-
176
- ### [3.0.1] - 2019-03-28
177
-
178
- ### Added
179
-
180
- - iOS implement config.stopOnTerminate using startMonitoringSignificantLocationChanges
181
-
182
- ### Fixed
183
-
184
- - Android fix don't start service on app visibility change events
185
- fixes: #552, #551
186
-
187
- ### [3.0.0] - 2019-03-25
188
-
189
- ### Fixed
190
-
191
- - Android fix don't start service on configure
192
- fixes: #552, #551
193
-
194
- ### [3.0.0-alpha.XY] - unreleased
195
-
196
- #### Added
197
-
198
- - checkStatus if service is running
199
- - events [start, stop, authorization, background, foreground]
200
- - implement all methods for both platforms
201
- - new RAW_LOCATION_PROVIDER
202
-
203
- Since alpha.8:
204
-
205
- - onError event signature = { code, message }
206
- - post/sync attributes customization via postTemplate config prop
207
- - enable partial plugin reconfiguration
208
- - Android on "activity" event
209
- - iOS configuration persistence
210
-
211
- Since alpha.12:
212
-
213
- - iOS ACTIVITY_PROVIDER (experimental)
214
-
215
- Since alpha.15:
216
-
217
- - checkStatus returns status of location services (locationServicesEnabled)
218
- - iOS RAW_LOCATION_PROVIDER continue to run on app terminate
219
-
220
- Since alpha.19:
221
-
222
- - Android Headless Task
223
-
224
- Since alpha.20:
225
-
226
- - Android location parameters isFromMockProvider and mockLocationsEnabled
227
-
228
- Since alpha.24:
229
-
230
- - Android Oreo support
231
-
232
- Since alpha.25:
233
-
234
- - method forceSync
235
- - option to get logs by offset and filter by log level
236
- - log uncaught exceptions
237
-
238
- Since alpha.30:
239
-
240
- - method getCurrentLocation
241
-
242
- Since alpha.41:
243
-
244
- - notificationsEnabled config option (by [@danielgindi](https://github.com/danielgindi/))
245
- More info: <https://github.com/mauron85/react-native-background-geolocation/pull/269>
246
- - Allow stopping location updates on status "285 Updates Not Required" (by [@danielgindi](https://github.com/danielgindi/))
247
- More info: <https://github.com/mauron85/react-native-background-geolocation/pull/271>
248
-
249
- Since alpha.45:
250
-
251
- - Listen for 401 Unauthorized status codes received from http server (by [@FeNoMeNa](https://github.com/FeNoMeNa/))
252
- More info: <https://github.com/mauron85/react-native-background-geolocation/pull/308/files>
253
-
254
- Since alpha.46:
255
-
256
- - typescript definitions
257
-
258
- Since alpha.47:
259
-
260
- - allow nested location props in postTemplate
261
-
262
- #### Changed
263
-
264
- - start and stop methods doesn't accept callback (use event listeners instead)
265
- - for background syncing syncUrl option is required
266
- - on Android DISTANCE_FILTER_PROVIDER now accept arbitrary values (before only 10, 100, 1000)
267
- - all plugin constants are in directly BackgroundGeolocation namespace. (check index.js)
268
- - plugin can be started without executing configure (stored settings or defaults will be used)
269
- - location property locationId renamed to just id
270
- - iOS pauseLocationUpdates now default to false (becuase iOS docs now states that you need to restart manually if you set it to true)
271
- - iOS finish method replaced with startTask and endTask
272
-
273
- Since alpha.8:
274
-
275
- - Android bind to service on facade construct
276
-
277
- Since alpha.14:
278
-
279
- - iOS saveBatteryOnBackground defaults to false
280
-
281
- Since alpha.15:
282
-
283
- - shared code base with react-native
284
-
285
- Since alpha.25:
286
-
287
- - Android common error format
288
- - Android remove sync delay when conditions are met
289
- - Android consider HTTP 201 response code as succesful post
290
- - Android obey system sync setting
291
-
292
- Since alpha.28:
293
-
294
- - Android remove wake locks
295
- <https://github.com/mauron85/background-geolocation-android/pull/4> by @grassick
296
-
297
- Since alpha.29:
298
-
299
- - Android show service notification only when in background
300
- - Android remove config option startForeground (related to above)
301
-
302
- Since alpha.32:
303
-
304
- - Android bring back startForeground config option (BREAKING CHANGE!)
305
-
306
- startForeground has slightly different meaning.
307
-
308
- If false (default) then service will create notification and promotes
309
- itself to foreground service, when client unbinds from service.
310
- This typically happens when application is moving to background.
311
- If app is moving back to foreground (becoming visible to user)
312
- service destroys notification and also stop being foreground service.
313
-
314
- If true service will create notification and will stay in foreground at all times.
315
-
316
- Since alpha.33:
317
-
318
- - Android internal changes (permission handling)
319
-
320
- Since alpha.40:
321
-
322
- - Android disable notification sound and vibration on oreo
323
- (PR: [#9](https://github.com/mauron85/background-geolocation-android/pull/9)
324
- by [@danielgindi](https://github.com/danielgindi/))
325
-
326
- Since alpha.48:
327
-
328
- - removeAllListeners - remove all event listeners when calling without parameter
329
-
330
- Since alpha.50:
331
-
332
- - export BackgroundGeolocationPlugin interface for ionic users (fixes #515)
333
-
334
- ### Fixed
335
-
336
- Since alpha.13:
337
-
338
- - iOS open location settings on iOS 10 and later (PR #158) by @asafron
339
-
340
- Since alpha.15:
341
-
342
- - checkStatus authorization
343
- - Android fix for #362 Build Failed: cannot find symbol (PR #378)
344
-
345
- Since alpha.18:
346
-
347
- - Android fix #276 - NullPointerException: onTaskRemoved
348
- - Android fix #380 - allow to override android support library
349
-
350
- Since alpha.19:
351
-
352
- - Android fix event listeners not triggering after app is restarted and service was running
353
-
354
- Since alpha.23:
355
-
356
- - iOS fix #394 - App Store Rejection - Prefs Non-Public URL Scheme
357
- - iOS reset connectivity status on stop
358
-
359
- Since alpha.24:
360
-
361
- - Android fix service accidently started with default or stored config
362
-
363
- Since alpha.25:
364
-
365
- - Android add guards to prevent some race conditions
366
- - Android config null handling
367
-
368
- Since alpha.31:
369
-
370
- - iOS fix error message format
371
- - iOS fix missing getLogEntries arguments
372
-
373
- Since alpha.32:
374
-
375
- - iOS display debug notifications in foreground on iOS >= 10
376
- - iOS missing activity provider stationary event
377
- - Android getCurrentLocation request permission prompt
378
-
379
- Since alpha.35:
380
-
381
- - Android fix issue #431 - "dependencies.gradle" not found
382
-
383
- Since alpha.38:
384
-
385
- - iOS Fix crash on delete all location ([7392e39](https://github.com/mauron85/background-geolocation-ios/commit/7392e391c3de3ff0d6f5ef2ef19c34aba612bf9b) by [@acerbetti](https://github.com/acerbetti/))
386
-
387
- Since alpha.39:
388
-
389
- - Android Defer start and configure until service is ready
390
- (PR: [#7](https://github.com/mauron85/background-geolocation-android/pull/7)
391
- Commit: [00e1314](https://github.com/mauron85/background-geolocation-android/commit/00e131478ad4e37576eb85581bb663b65302a4e0) by [@danielgindi](https://github.com/danielgindi/),
392
- fixes #201, #181, #172)
393
-
394
- Since alpha.40:
395
-
396
- - iOS Avoid taking control of UNUserNotificationCenter
397
- (PR: [#268](https://github.com/mauron85/react-native-background-geolocation/pull/268))
398
-
399
- Since alpha.42:
400
-
401
- - Android fix locationService treating success as errors
402
- (PR: [#13](https://github.com/mauron85/background-geolocation-android/pull/13)
403
- by [@hoisel](https://github.com/hoisel/))
404
-
405
- Since alpha.43:
406
-
407
- - Android make sure mService exists when we call start or stop
408
- (PR: [#17](https://github.com/mauron85/background-geolocation-android/pull/17)
409
- by [@ivosabev](https://github.com/ivosabev/))
410
-
411
- Since alpha.46:
412
-
413
- - Android fix service crash on boot for Android 8 when startOnBoot option is used
414
-
415
- Since alpha.48:
416
-
417
- - fix typescript definitions (fixes #514)
418
- - Android prefix resource strings to prevent collision with other plugins
419
-
420
- Since alpha.49:
421
-
422
- - Android fix App Crashes when entering / leaving Background
423
- - Android fix crash on permission when started from background
424
-
425
- ### [2.3.6] - 2018-09-11
426
-
427
- ### Fixed
428
-
429
- - Android remove non public URL
430
-
431
- ### [2.3.5] - 2018-03-29
432
-
433
- ### Fixed
434
-
435
- - Android fix #384
436
-
437
- ### [2.3.3] - 2017-11-17
438
-
439
- ### Added
440
-
441
- - Android allow override google play services version
442
-
443
- ### [2.3.2] - 2017-11-06
444
-
445
- ### Fix
446
-
447
- - iOS support for iOS 11 (#PR 330)
448
-
449
- ### [2.3.1] - 2017-10-31
450
-
451
- ### Fix
452
-
453
- - iOS httpHeaders values are not sent with syncUrl on iOS PR #325
454
-
455
- ### [2.3.0] - 2017-10-31
456
-
457
- ### Added
458
-
459
- - Android Make account name configurable PR #334 by unixmonkey
460
-
461
- ### [2.2.5] - 2016-11-13
462
-
463
- ### Fixed
464
-
465
- - Android fixing issue #195 PR204
466
-
467
- ### [2.2.4] - 2016-09-24
468
-
469
- ### Fixed
470
-
471
- - iOS extremely stupid config bug from 2.2.3
472
-
473
- ### [2.2.3] - 2016-09-23
474
-
475
- ### Fixed
476
-
477
- - Android issue #173 - allow stop service and prevent crash on destroy
478
-
479
- ### [2.2.2] - 2016-09-22
480
-
481
- ### Added
482
-
483
- - Android android.hardware.location permission
484
-
485
- ### Fixed
486
-
487
- - iOS onStationary null location
488
- - iOS fix potential issue sending outdated location
489
- - iOS handle null config options
490
-
491
- ### [2.2.1] - 2016-09-15
492
-
493
- ### Added
494
-
495
- - iOS suppress minor error messages on first app run
496
-
497
- ### [2.2.0] - 2016-09-14
498
-
499
- ### Added
500
-
501
- - iOS option pauseLocationUpdates PR #156
502
-
503
- ### [2.2.0-alpha.8] - 2016-09-02
504
-
505
- ### Fixed
506
-
507
- - iOS compilation errors
508
-
509
- ### [2.2.0-alpha.7] - 2016-09-01
510
-
511
- #### Removed
512
-
513
- - Android location filtering
514
-
515
- ### Changed
516
-
517
- - Android db logging instead of file
518
- - iOS location prop heading renamed to bearing
519
-
520
- ### [2.2.0-alpha.6] - 2016-08-10
521
-
522
- ### Fixed
523
-
524
- - Android don't try sync when locations count is lower then threshold
525
-
526
- ### [2.2.0-alpha.5] - 2016-08-10
527
-
528
- ### Fixed
529
-
530
- - Android issue #130 - sync complete notification stays visible
531
- - Android don't try sync when locations count is zero
532
-
533
- ### [2.2.0-alpha.4] - 2016-08-10
534
-
535
- ### Fixed
536
-
537
- - Android issue #137 - fix only for API LEVEL >= 17
538
-
539
- ### [2.2.0-alpha.3] - 2016-08-10
540
-
541
- ### Fixed
542
-
543
- - Android issue #139 - Starting backgroundGeolocation just after configure failed
544
-
545
- ### [2.2.0-alpha.2] - 2016-08-10
546
-
547
- ### Fixed
548
-
549
- - iOS issue #132 use Library as DB path
550
-
551
- ### [2.2.0-alpha.1] - 2016-08-01
552
-
553
- ### Added
554
-
555
- - Android, iOS limit maximum number of locations in db (maxLocations)
556
- - Android showAppSettings
557
- - Android, iOS database logging (getLogEntries)
558
- - Android, iOS autosync locations to server with configurable threshold
559
- - Android, iOS method getValidLocations
560
- - iOS watchLocationMode and stopWatchingLocationMode
561
- - iOS configurable NSLocationAlwaysUsageDescription
562
-
563
- ### Changed
564
-
565
- - Locations stored into db at all times
566
- - iOS persist locations also when url option is not used
567
- - iOS dropping support for iOS < 4
568
-
569
- ### Fixed
570
-
571
- - Android fix crash on permission change
572
- - Android permission error code: 2
573
- - Android on start err callback instead configure err callback
574
- - Android overall background service reliability
575
- - iOS do not block js thread when posting locations
576
-
577
- ### [2.1.2] - 2016-06-23
578
-
579
- ### Fixed
580
-
581
- - iOS database not created
582
-
583
- ### [2.1.1] - private release
584
-
585
- ### Fixed
586
-
587
- - iOS switching mode
588
-
589
- ### [2.1.0] - private release
590
-
591
- ### Added
592
-
593
- - iOS option saveBatteryOnBackground
594
- - iOS time validation rule for location
595
-
596
- ### [2.0.0] - 2016-06-17
597
-
598
- ### Fixed
599
-
600
- - iOS prevent unintentional start when in background
601
- - Android Destroy Existing Provider Before Creating New One (#94)
602
-
603
- ### [2.0.0-rc.3] - 2016-06-13
604
-
605
- #### Fixed
606
-
607
- - iOS memory leak
608
-
609
- ### [2.0.0-rc.1] - 2016-06-13
610
-
611
- #### Changed
612
-
613
- - Android notificationIcon option split into small and large!!!
614
- - Android stopOnTerminate defaults to true
615
- - Android option locationService renamed to locationProvider
616
- - Android providers renamed (see README.md)
617
- - Android bugfixing
618
- - SampleApp moved into separate repo
619
- - deprecated backgroundGeoLocation
620
- - iOS split cordova specific code to allow code sharing with react-native-background-geolocation
621
- - desiredAccuracy map any number
622
- - Android locationTimeout option renamed to interval
623
- - iOS switchMode (formerly setPace)
624
-
625
- #### Added
626
-
627
- - Android startOnBoot option
628
- - Android startForeground option
629
- - iOS, Android http posting of locations (options url and httpHeaders)
630
- - iOS showLocationSettings
631
- - iOS showAppSettings
632
- - iOS isLocationEnabled
633
- - iOS getLocations
634
- - iOS deleteLocation
635
- - iOS deleteAllLocations
636
- - iOS foreground mode
637
-
638
- #### Removed
639
-
640
- - WP8 platform
641
- - Android deprecated window.plugins.backgroundGeoLocation
642
-
643
- ### [1.0.2] - 2016-06-09
644
-
645
- #### Fixed
646
-
647
- - iOS queued locations are send FIFO (before fix LIFO)
648
-
649
- ### [1.0.1] - 2016-06-03
650
-
651
- #### Fixed
652
-
653
- - iOS7 crash on start
654
- - iOS attempt to fix #46 and #39
655
-
656
- ### [1.0.0] - 2016-06-01
657
-
658
- #### Added
659
-
660
- - Android ANDROID_FUSED_LOCATION stopOnStillActivity (enhancement #69)
661
-
662
- ### [0.9.6] - 2016-04-07
663
-
664
- #### Fixed
665
-
666
- - Android ANDROID_FUSED_LOCATION fixing crash on start
667
- - Android ANDROID_FUSED_LOCATION unregisterReceiver on destroy
668
-
669
- ### [0.9.5] - 2016-04-05
670
-
671
- #### Fixed
672
-
673
- - Android ANDROID_FUSED_LOCATION startTracking when STILL after app has started
674
-
675
- ### [0.9.4] - 2016-01-31
676
-
677
- #### Fixed
678
-
679
- - Android 6.0 permissions issue #21
680
-
681
- ### [0.9.3] - 2016-01-29
682
-
683
- #### Fixed
684
-
685
- - iOS cordova 6 compilation error
686
- - iOS fix for iOS 9
687
-
688
- #### Changes
689
-
690
- - iOS removing cordova-plugin-geolocation dependency
691
- - iOS user prompt for using location services
692
- - iOS error callback when location services are disabled
693
- - iOS error callback when user denied location tracking
694
- - iOS adding error callbacks to SampleApp
695
-
696
- ### [0.9.2] - 2016-01-29
697
-
698
- #### Fixed
699
-
700
- - iOS temporarily using cordova-plugin-geolocation-ios9-fix to fix issues with iOS9
701
- - iOS fixing SampleApp indexedDB issues
702
-
703
- ### [0.9.1] - 2015-12-18
704
-
705
- #### Fixed
706
-
707
- - Android ANDROID_FUSED_LOCATION fix config setActivitiesInterval
708
-
709
- ### [0.9.0] - 2015-12-18
710
-
711
- #### Changed
712
-
713
- - Android ANDROID_FUSED_LOCATION using ActivityRecognition (saving battery)
714
-
715
- ### [0.8.3] - 2015-12-18
716
-
717
- #### Fixed
718
-
719
- - Android fixing crash on exit
720
-
721
- ### [0.8.2] - 2015-12-18
722
-
723
- #### Fixed
724
-
725
- - Android fixing #9 - immediate bg service crash
726
-
727
- ### [0.8.1] - 2015-12-15
728
-
729
- #### Fixed
730
-
731
- - Android fixing #9
732
-
733
- ### [0.8.0] - 2015-12-15 (Merry XMas Edition :-)
734
-
735
- #### Fixed
736
-
737
- - Android persist location when main activity was killed
738
-
739
- #### Changed
740
-
741
- - Android persisting position when debug is on
742
-
743
- ### [0.7.3] - 2015-11-06
744
-
745
- #### Fixed
746
-
747
- - Android issue #11
748
-
749
- ### [0.7.2] - 2015-10-21
750
-
751
- #### Fixed
752
-
753
- - iOS fixing plugin dependencies (build)
754
- - iOS related fixes for SampleApp
755
-
756
- ### [0.7.1] - 2015-10-21
757
-
758
- #### Changed
759
-
760
- - Android ANDROID_FUSED_LOCATION ditching setSmallestDisplacement(stationaryRadius) (seems buggy)
761
-
762
- ### [0.7.0] - 2015-10-21
763
-
764
- #### Changed
765
-
766
- - Android deprecating config option.interval
767
- - Android allow run in background for FusedLocationService (wakeLock)
768
- - Android will try to persist locations when main activity is killed
769
- - Android new methods: (getLocations, deleteLocation, deleteAllLocations)
770
- - Android stop exporting implicit intents (security)
771
- - SampleApp updates
772
-
773
- ### [0.6.0] - 2015-10-17
774
-
775
- #### Changed
776
-
777
- - deprecating window.plugins clobber
778
- - SampleApp updates
779
-
780
- #### Added
781
-
782
- - Android showLocationSettings and watchLocationMode
783
-
784
- ### [0.5.4] - 2015-10-13
785
-
786
- #### Changed
787
-
788
- - Android only cosmetic changes, but we need stable base
789
-
790
- ### [0.5.3] - 2015-10-12
791
-
792
- #### Changed
793
-
794
- - Android not setting any default notificationIcon and notificationIconColor.
795
- - Android refactoring
796
- - Android updated SampleApp
797
-
798
- ### [0.5.2] - 2015-10-12
799
-
800
- #### Fixed
801
-
802
- - Android fixing FusedLocationService start and crash on stop
803
-
804
- ### [0.5.1] - 2015-10-12
805
-
806
- #### Fixed
807
-
808
- - Android fix return types
809
- - Android fix #3 NotificationBuilder.setColor method not present in API Level <21
810
-
811
- #### Changed
812
-
813
- - Android replacing Notication.Builder for NotificationCompat.Builder
814
- - SampleApp can send position to server.
815
- - SampleApp offline mode (IndexedDB)
816
-
817
- #### Removed
818
-
819
- - Android unnecessary plugins
820
- - Docs: removing instructions to enable cordova geolocation in foreground
821
- and user accept location services
822
-
823
- ### [0.5.0] - 2015-10-10
824
-
825
- #### Changed
826
-
827
- - Android FusedLocationService
828
- - Android package names reverted
829
- - Android configuration refactored
830
- - WP8 merged improvements
831
-
832
- #### Removed
833
-
834
- - Android unused classes
835
- - All removing deprecated url, params, headers
836
-
837
- ### [0.4.3] - 2015-10-09
838
-
839
- #### Added
840
-
841
- - Android Add icon color parameter
842
-
843
- #### Changed
844
-
845
- - Changed the plugin.xml dependencies to the new NPM-based plugin syntax
846
- - updated SampleApp
847
-
848
- ### [0.4.2] - 2015-09-30
849
-
850
- #### Added
851
-
852
- - Android open activity when notification clicked [69989e79a8a67485fc88463eec8d69bb713c2dbe](https://github.com/erikkemperman/cordova-plugin-background-geolocation/commit/69989e79a8a67485fc88463eec8d69bb713c2dbe)
853
-
854
- #### Fixed
855
-
856
- - Android duplicate desiredAccuracy extra
857
- - Android [compilation error](https://github.com/coletivoEITA/cordova-plugin-background-geolocation/commit/813f1695144823d2a61f9733ced5b9fdedf15ff3)
858
-
859
- ### [0.4.1] - 2015-09-21
860
-
861
- - maintenance version
862
-
863
- ### [0.4.0] - 2015-03-08
864
-
865
- #### Added
866
-
867
- - Android using callbacks same as iOS
868
-
869
- #### Removed
870
-
871
- - Android storing position into sqlite