- Fix bug in
BackgroundGeolocation.loggerAPI
- [iOS] Fix bug in iOS License Validation Failure modal dialog interfering with React Native app launching. Change to less intrusive alert mechanism.
- [iOS] Fix bug returning wrong data-structure to watchPosition callback.
- [iOS] Fix first-launch issue with initial call to
.start(). - [iOS] Fix config.authorization bug (refreshPayload and refreshHeaders being ignored).
- [Android] Re-factor Android activity life-cycle management. It's all done internally within SDK now. No need for react-native plugin code to manually listen to Activity lifecycle and poke the SDK when interesting events happen.
- Fix bug not respecting
PersistenceConfig.geofenceTemplate - [iOS] Fix bug in
setOdometernot resolving itsPromise
- [Android] Fix incorrect references to
TSLog.loggerinHeadlessTask.java,HeadlessTaskManager.java
- Promote 5.0.0 from beta. See the Migration Guide and v5.0.0 Discussion
- [Android] update proguard-rules.pro to prevent key classnames being minified (eg: HeadlessTask)
- [Expo] Update Expo plugin and Setup Instructions for 5.0.0-beta
- Implement React Native Turbo Modules ("New Architecture").
- Initial introduction of v5 beta. See the Migration Guide.
- [Android] Backport spurious stationary geofence exit detection from v5. Google Play Services seems to have a bug where geofence exit events fire even while the device is still inside the geofence, causing the SDK to constantly enter the moving state, draining the battery.
- [Android] Rebuild with Android ELF alignment
- [Android] re-build Expo plugin
- [Android] pin
tslocationmanagerat3.+in preparation for next release..
- [Android] Drop Huawei HMS support for failure to provide Android 16KB Page support in their SDKs.
- [Android] Implement behaviour for
locationAuthorizationRequest: "Any"to not continue showingbackgroundPermissionRationaleafter user clicks[CANCEL]button. - [Android] Rebuild
tslocationmanagerwith AGP >= 8.5.1 (16KB page size support)
- [Android] Fix issue with polygon geofencing where
identifierconsists of long strings, such asaaaa-bbbb-cccccccc-dddd-eeeee eeeeeee. - [Android] Fix edge-case where polygons can fail to fire after the containing geofence is exited. This could happen if the containing geofence was exited without trigger an onMotionChange event.
- [iOS] Fix edge-case where polygon could fail to fire EXIT event after launching from terminated state when the containing geofence is exit causes background app restart.
- [Android][Expo] Expo plugin renders the
app.gradleline inandroid/app/build.gradlerendered in wrong position (withinandroid { } block -- should be *outside and before*android {}` block). - [Android] Support 16KB page sizes
- [Android] Fix
java.util.ConcurrentModificationException at com.transistorsoft.locationmanager.location.SingleLocationRequest.getBestLocation. - For
Config.authorization, addid_tokenas an accepted synonym for "access_token" received from authorization server (Google Cloud format).
- [iOS] Fix
ProviderChangeEvent.enablednot showing the result of global Privacy -> Location Services -> Enabled switch
- [Android] Re-compile library with jdk 17 instead of 22
- [Android] Fix
ConcurrentModificationExceptioninStopTimeoutEvaluator.
- [Android] Catch database exceptions hydrating records from SQLite.
- [Android] Fix
ObjectAlreadyConsumedException. - [Android] Address phenomenon of UI freezing.
- [Android] Oops, accidentally removed deprecated
packageattribute from plugin'sAndroidManifest-- this is required by RN's auto-linking!
- [Android] Re-factor HeadlessTask.java. Introduce HeadlessTaskManager class.
- [Android] remove previous requirement in
4.18.1to callBackgroundGeolocation.finishHeadlessTask(taskId).
- [Android] implement support for new "Bridgeless Architecture"
- [Android] Remove enforcement of minimum Geofence radius
150 - [Android] Fix issue with
TSLocationManagerActivity(responsible for showing location permission / authorization dialogs). Minimizing the app with an active permission dialog would cause the app'sMainActivityto terminate on some devices.
- [Android] Fix reported "screen flickering" issue on some devices when SDK requests permissions.
- [Android] Address Android synchronization issue with
TSLocation.toMap. - [iOS] Address crash in
TSConfigdue to "uncaught exception NSInvalidArgumentException" - [Android] Change
foregroundServiceTypeonLocationRequestServicefromshortService->location. - [iOS] Address inconsistent location-tracking performance on iOS.
- [iOS] Fix bug with
triggerActivitespreventing motion-triggering in iOS simulator with simulated location.
- [Android] Implement
Service.onTimeoutto handleforegroundServiceType="shortService"timeouts. - [iOS] Add new
Config.activityTypeACTIVITY_TYPE_AIRBORNE. - [iOS] Implement
Config.triggerActivitiesfor iOS. - [Android] Guard against
NullPointerExceptionreceiving a null location inPolygonGeofenceServiceevent. - Fix crash in RPC action for
addGeofencewhen adding polygon geofence. - Add two new RPC actions
setOdometer,resetOdometer. - [iOS] Fix broken linking to Settings screen in
locationAuthorizationAlerton iOS 18.
- [Android] Address possible leak of
Activityreference when terminating the app. Ensure internal reference toActivityis nullified when app is terminated. - [Android] Add improvements to Android geofencing-only mode with
goefenceModeHighAccuracy: truewhere motion-activity updates disabled. - [Android] Add error-checking in polygon-geofencing to handle a possible
NullPointerException.
- [Expo] Fix bug in Expo plugin adding unused license keys for "polygon geofencing" with a value of
UNDEFINED, causing license-validation error. Add logic to automatically remove license keys fromAndroidManifestwhen corresponding keys are not found in yourapp.json(eg:polygonLicense).
- [iOS] Fix bug in iOS Polygon Geofencing when running in geofences-only mode (
.startGeofences). iOS would mistakenly turn off location updates exactly 3 samples into the containing circular geofence of a polygon. - Implement
notifyOnDwellfor polygon-geofences.
- [Expo] Backport Expo license-key fix from
4.17.1.
- [Android][Expo] Conditionally add polygonLicense only if provided in Config. Do not write to AndroidManifest unless provided.
- [Android][Expo] Implement polygonLicense Config option
- [Android] Remove permission
FOREGROUND_SERVICE_HEALTH. It turns out that this permission is no longer required whe n theActivityRecognitionServivceis defined with aforegroundServiceType="shortservice", instead of"health", which allows a background -launched foreground-service to stay active for up to 3 minutes, which is sufficient for theActivityRecognitionServic e, which typically stays activated only for a few milliseconds. - [Android] Fix "Multiple geofence events triggered for a single geofence registration when registered individually".
- [Android] Fix bug in .getCurrentPosition not returning or throwing an error in a condition where Network OFF and GPS ON.
- [iOS] Code-sign
TSLocationManager.xcframeworkwith new Apple Organization (9224-2932 Quebec Inc) certificate.
- [iOS] codesign
TSLocationManage.xcframework - [iOS] Update
CocoaLumberjackversion ->3.8.5(version which includes its ownPrivacyInfo) - [iOS] Implement new iOS Privacy Manifest
- Add property
AuthorizationEvent.status, provding the HTTP status code from therefreshUrl.
- [iOS] Fix bug in iOS scheduler, triggering ON incorrectly. For example, given a
schedule: ['1 00:00-23:59'], the plu gin was trigging on forDAY 2`.
- [iOS] Fix bug in polygon-geofencing: monitoredIdentifiers not being cleared when
.removeGeofences()is called, can result in null-pointer exception. - [Android] Change
foregroundServiceTypeof the SDK'sGeofencingServicedefinition in itsAndroidManifestfromshortService->location.
- [iOS] Modify behaviour of stop-detection system to NOT turn off location-services but merely adjust desiredAccuracy as high as possible. There were problems reported using
locationAuthorizationRequest: 'WhenInUse'with recent versions of iOS where the stop-detection system could put the app to sleep during tracking if the motion API reported the device became momentarily stationary.
- [Expo][Android] Fix bug for Expo v50 "Invalid regular expression".
- [Android] Fix problem with polygon-geofencing license-validation not working in DEBUG builds when configured with pro duct flavors.
- [Android] HMS geolocation event does not provide a timestamp for the triggering location!! Use System current time.
- [Android] Guard against Geofence SQLite query returning null in
GeofencingService. - [Android] Fix
ConcurrentModificationExceptioninSingleLocationRequest.getBestLocation
- [Android] Fix
IllegalStateExceptioncalling addGeofences when number of geofences exceeds platform maximum (100).
- [Android]
getGeofence/getGeofencesnot returning newGeofence.verticesproperty.
- [iOS] Fix "Duplicate symbol error DummyPods_TSLocationManager".
- [Android] Fix timeout issue in
.watchPosition.
- Polygon Geofencing: The Background Geolocation SDK now supports Polygon Geofences (Geofences of any shape). For more information, see API docs
Geofence.vertices. ℹ️ Polygon Geofencing is sold as a separate add-on (fully functional in DEBUG builds).
- Remove
backup_rules.xmlfromAndroidManifest.xml— it's causing conflicts with other plugins. - [Android] Add proguard-rule for compilation of the android library to prevent from obfuscating the
BuildConfigclass toa.a.class, conflicting with other libraries.
- [Android] Performance enhancements and error-checking.
- [Typescript] Add missing
LocationErrorvalue3;
- [Android] Fix memory-leak in
.startBackgroundTask: If aTasktimed-out and is "FORCE KILLED", it was never removed from aList<Task>. - [Android] Fix
Exception NullPointerException:at com.transistorsoft.locationmanager.util.BackgroundTaskWorker.onStopped
- [Android]
⚠️ If you have the following elements defined in yourAndroidManifest.xml, DELETE them:
- <service android:name="com.transistorsoft.locationmanager.service.TrackingService" android:foregroundServiceType="location" />
- <service android:name="com.transistorsoft.locationmanager.service.LocationRequestService" android:foregroundServiceType="location" />- [iOS] Fix build failure "Use of '@import' when C++ modules are disabled"
- [Android] Modify Foreground-service management to use
stopSelfResult(startId)instead ofstopSelf(). This could improve reports of Android ANRContext.startForeground. - [Android] Re-factor getCurrentPosition to prefer more recent location vs more accuracy (within limits)
- [Android] Android 14 (API 34) support: Android 14 is more strict with scheduling
AlarmManager"exact alarms" (which the plugin does take advantage of). If you wish the plugin to useAlarmManager"exact alarms" in your app, you must now explicitly define that permission in your ownAndroidManifest:
<manifest>
<uses-permission android:minSdkVersion="34" android:name="android.permission.USE_EXACT_ALARM" />
</manifest>- [Android] Android 14 (API 34) support: Re-factor BackgroundTaskService to use
WorkManagerinstead of a foreground-service. - [Android] Android 14 (API 34) support: Due to new runtime permission requirements on
AlarmManagerexact alarms (android.permission.SCHEDULE_EXACT_ALARM), the plugin can no longer rely upon launching a foreground-service using an exact alarm. Instead, the plugin will create a geofence around the current position (configured withinitialTriggerEntry) to hopefully immediately launch a foreground-service to handle the fake geofence event, since Android allows foreground-service launches due to Geofencing events. - [Android] Android 14 (API 34) support: All foreground-services now require an
android:foregroundServiceTypein the plugin'sAndroidManifest(handled automatically by the plugin). - [Android] Android 14 (API 34) support: Fix error "One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified" in
DeviceSettings.startMonitoringPowerSaveChanges. - [Android] Add sanity-check for invalid
Geofencearguments (eg: invalid latitude/longitude). - [Android] Add safety-checks in ForegroundService stop-handling. There was a report of a reproducible crash while aggressively calling
.getCurrentPositionin aTimer(eg: every second). - [Android] Demote
HeartbeatServicefrom a Foreground Service toAlarmManagerONESHOT.⚠️ In youronHeartbeatevent, if you intend to perform any kind of asynchronous function, you should wrap it insideBackgroundGeolocation.startBackgroundTaskin order to prevents the OS from suspending your app before your task is complete:
BacckgroundGeolocation.onHeartbeat(async (event) => {
console.log("[onHeartbeat] $event");
// First register a background-task.
const taskId = await BackgroundGeolocation.startBackgroundTask();
try {
// Now you're free to perform long-running tasks, such as getCurrentPosition()
const location = await BackgroundGeolocation.getCurrentPosition({
samples: 3,
timeout: 30,
extras: {
"event": "heartbeat"
}
});
console.log("[onHeartbeat] location:", $location);
} catch(error) {
console.log("[getCurrentPosition] ERROR:", error);
}
// Be sure to singal completion of your background-task:
BackgroundGeolocation.stopBackgroundTask(taskId);
});- [Android] Fix NPE iterating a
ListinAbstractService. - [Android] If a
SingleLocationRequesterror occurs and at least one sample exits, prefer to resolve the request successfully rather than firing the error (eg:getCurrentPosition,motionchange,providerchangerequests).
- [Android][Expo] Adjust Expo plugin with Support for monorepos where the module may not exist in the expected node_modules path.
- [Android] Introduce gradle config ext vars for
logbackAndroidVersionandslf4jVersion.
- [Android] Gradle v8 now requires
namespaceattribute in gradle files. - [iOS] iOS 16.4 made a major change to location-services, exposed only when
Config.showsBackgroundLocationIndicatorisfalse(the default). As a result of this change,Config.showsBackgroundLocationIndicatorwill now default totrue.
- Add Huawei HMS License support for the Expo plugin.
- [Android] Upgrade
logback-androiddependency to3.0.0(org.slf4j-apito `2.0.7).
-
[Android] Fix String concatenation issue on Turkish devices where method-name composed for use with reflection is in correctly capitalized (ie:
isMoving -> setIsMovingis incorrectly capitalized with Turkish capital assetİsMoving. Simply enforceLocale.ENGLISHwhen performingString.toUpperCase(Locale.ENGLISH). -
[iOS] Fix bug in TSScheduler. When schedule was cleared via .setConfig, only the State.schedulerEnabled property was set to false, but the TSScheduler singleton contained an internal 'enabled' property which was not reset to false. Solution was to simply call stop() method upon TSScheduler singleton.
- [Android] Bump default
hmsLocationVersion = 6.9.0.300. There are reports of Google rejecting apps due to older huawei HMS dependencies. - [Android] Fix
ClassCastExceptionrelated to Motion API error
- [Android] Introduce Huawei HMS Support. Requires a separate license key purchased here.
- [iOS] Fix for iOS 16.4. iOS 16.4 introduces changes to CoreLocation behaviour when using Config.showsBackgroundLocationIndi cator: false.
- [Android] Added extra logic in a location error-handler to mitigate against a possible edge-case where a location-error fetching the onMotionChange position could possibly result in an infinite loop, causing a stackoverflow exception:
at com.transistorsoft.locationmanager.service.TrackingService.changePace(TrackingService.java:264)
at com.transistorsoft.locationmanager.service.TrackingService$c.onError(TrackingService.java:69)
at com.transistorsoft.locationmanager.location.SingleLocationRequest.onError(SingleLocationRequest.java:18)
at com.transistorsoft.locationmanager.location.SingleLocationRequest.start(SingleLocationRequest.java:71)
at com.transistorsoft.locationmanager.location.TSLocationManager.getCurrentPosition(TSLocationManager.java:3)
at com.transistorsoft.locationmanager.service.TrackingService.changePace(TrackingService.java:321)
at com.transistorsoft.locationmanager.service.TrackingService$c.onError(TrackingService.java:69)
at com.transistorsoft.locationmanager.location.SingleLocationRequest.onError(SingleLocationRequest.java:18)
at com.transistorsoft.locationmanager.location.SingleLocationRequest.start(SingleLocationRequest.java:71)
at com.transistorsoft.locationmanager.location.TSLocationManager.getCurrentPosition(TSLocationManager.java:3)
at com.transistorsoft.locationmanager.service.TrackingService.changePace(TrackingService.java:321)
at com.transistorsoft.locationmanager.service.TrackingService$c.onError(TrackingService.java:69)
at com.transistorsoft.locationmanager.location.SingleLocationRequest.onError(SingleLocationRequest.java:18)
at com.transistorsoft.locationmanager.location.SingleLocationRequest.start(SingleLocationRequest.java:71)
.
.
.
- [Android] Fix expo plugin failing on Expo SDK >= 48. Regular expressions failed because Expo changed lines in the build.gradle files that the Expo plugin was using for anchors for where to inject new src. Changed to use more fundamental anchor elements for regular expressions that must exist.
- [Fixed][Android] Implement support for
play-services-location v21(ext.playServicesLocationVersionin yourandroid/build.gradle). The plugin can now work with either<= v20or>= v21.
- [Fixed] Fixed inconsistency in API docs with
location.activity(location.activity.type) andMotionChangeEventprovided toonActivityChange(motionActivityEvent.activity). - [Changed] Android Update
logback-androidversion.
- [Fixed] Android: Catch
Fatal Exception: java.lang.IllegalArgumentException: NetworkCallback was already unregistered - [Fixed] Android It has been discovered that the Android logger
logback-androidhas not been automatically clearing all expired records (Config.logMaxDays) from the log database. Thelogback-androiddatabase consists of three tables and only one was being cleared (see tony19/logback-android#214), resulting in a constantly growing database (wherelogLevel > LOG_LEVEL_OFF). This version of the plugin will alter thelogback-androiddatabase tables withON DELETE CASCADEto ensure all log-data is properly removed. - [Added] Added two new HTTP RPC commands
stopScheduleandstartSchedule(See API docs HTTP Guide for more information).
- [Android] Fix logic error with
getCurrentPositionnot respectingtimeout.
- [Android]
play-services:locationhas introduced a breaking change inv21, breaking the plugin.googlePlayServicesLocationVersionwill be capped with a maximum ofv20. The next major release (4.10.0) will set a minimum required version ofv21. - [Expo] The plugin now implements an Expo plugin for automated Setup.
- [iOS] Fix bug in iOS scheduler firing on days where it should not.
- [iOS] Rebuild
TSLocationManager.xcframeworkwith XCode 13 (instead of XCode 14). - [Android] Add new Config
Notification.channelIdfor custom customizing theNotificationChannelid. Some use rs have an existing foreground-service andNotificationChannelso wish to have the plugin's foreground-service s share the same notification and channel. This option should generally not be used. - [Android] Add permission
android.permission.POST_NOTIFICATIONSfor Android 13 (targetSdkVersion 33). Requ ired to allow enabling notifications in Settings->Apps. - [Android] Add new Config option
Authorization.refreshHeadersfor full control over HTTP headers sent toAuthor ization.refreshUrlwhen refreshing auth token. - [Android] Add
nullcheck when executingPowerManager.isPowerSaveMode() - [Android] Add new
Config.disableProviderChangeRecord (default false)to allow disabling the automatical HTTP POST of theonProviderChangelocation record. Some users do not want this automatically uploaded locatio n whenever the state of location-services is changed (eg: Location-services disabled, Airplane mode, etc). - [Android] Fix bug with
disableMotionActivityUpdates: trueand calling.start()followed immediately by.changePace(true). The SDK would fail to enter the moving state, entering the stationary state instead. - [iOS] Add new iOS 15
CLLocationattributeLocation.ellipsoidal_altitudeThe altitude as a height above the World Geodetic System 1984 (WGS84) ellipsoid, measured in meters. AndroidLocation.altitudehas always returned ellipsoidal altutude, so bothLocation.altitudeandLocation.ellipsoidal_altitudewill return the same value.
- [Android] Fix
java.lang.IllegalArgumentExceptionTSProviderManager.handleProviderChangeEvent`. - [Android]
startOnBoot: falsewithstopOnTerminate: falsecould start-on-boot. - [Android]
State.enabledreturned by calling.stop()returnstruedue to implementation running in a background-thread butcallbackexecuted immediately on the main-thread. However, requesting.getState()immediately after calling.stopwould return the correct value ofState.enabled - [Android] Fix
notification.stickynot being respected.
- Fix issue for react-native 0.69: They made a breaking change with the old, unused react-native.config.js, causing builds to fail. Simply delete the file
react-native.config.js.
- [Android] Fix bug in
onProviderChangeevent: not properly detecting when location-services disabled. - [Android] Android 12: Guard
Context.startForegroundServicewithtry / catch: the plugin will now catch exceptionForegroundServiceStartNotAllowedExceptionand automatically retry with anAlarmManageroneShot event. - [Android] Android 12: Refactor foreground-service management for Android 12: A way has been found to restore the traditional behaviour of foreground-services, allowing them to stop when no longer required (eg: where the plugin is in the stationary state).
- [Android] Refactor application life-cycle management. Remove deprecated permission
android.permission.GET_TASKStraditionally used for detecting when the app has been terminated. The new life-cycle mgmt system can detect Android headless-mode in a much more elegant manner. - [Android] Better handling for
WhenInUsebehaviour: The plugin will not allow.changePace(true)to be executed when the app is in the background (since Android forbids location-services to initiated in the background withWhenInUse). - [Android] Refactor
useSignificantChangesOnlybehaviour. Will use a defaultmotionTriggerDelaywith minimum 60000ms, minimumdistanceFilter: 250and enforcedstopTimeout: 20. - [iOS] iOS 15 has finally implemented Mock Location Detection.
location.mockwill now be present for iOS when the location is mocked, just like Android. - [Android] Re-factor onProviderChange. Add broadcast-receiver for
AIRPLANE_MODEdetection. - [Android] Add guard against Android 12 issue where location-services fail to turn off after terminate and plugin enters stationary state.
- [Android] Prevent recording motionchange position from running after onProviderChange.
- [Android] Fix bug in Android 12 support for executing
.start()in background while terminated. UsedJobSchedulerONESHOT instead ofAlarmManager. - [Android] Plugin could be placed into an infinite loop requesting motionchange position in some cases.
- [Android] Address
ConcurrentModificationExceptioninonPermissionGranted.
- [Android] If on device reboot location-services fails to provide a location (eg: timeout, airplane mode), the plugin would rely on motion API events to try again. This is a problem if the motion api is disabled. Instead, the SDK will keep trying to retrieve a location.
- [Android] Android 12 support for
ForegroundServiceStartNotAllowedException: immediately launch the SDK'sTrackingServiceas soon as.start()executes. If a location-timeout occurs while fetching the onMotionChange position after device reboot withstartOnBoot: true, theForegroundServiceStartNotAllowedExceptioncould be raised. - [Android] Add two new attributes
android:enabledandandroid:permissionto the SDK's built-inBootReceiver:
<receiver android:name="com.transistorsoft.locationmanager.BootReceiver" android:enabled="true" android:exported="false" android:permission="android.permission.RECEIVE_BOOT_COMPLETED">- [Android] Android 12 support for executing
.start()and.getCurrentPosition()while the plugin is disabled and in the background. This is a bypass of new Android 12 restrictions for starting foreground-services in the background by taking advantage of AlarmManager.
Fatal Exception: android.app.ForegroundServiceStartNotAllowedException: startForegroundService() not allowed due to mAllowStartForeground false: service
- [Android] Added two new
androidx.lifecycledependencies to plugin'sbuild.gradle, in addition to correspondingextvarsext.lifeCycleRunTimeVersionandext.lifeCycleRuntimeVersion
"androidx.lifecycle:lifecycle-runtime""androidx.lifecycle:lifecycle-extensions"
- [Android] Add a few extra manufacturer-specific
IntentforDeviceSettings.showPowerManager(). - [Android] Minimum
compileSdkVersion 31is now required. - [Android] Now that a minimum
targetSdkVersion 29is required to release an Android app to Play Store, the SDK'sAndroidManifestnow automatically appliesandroid:foregroundServiceType="location"to all requiredServicedeclarations. You no longer need to manually provide overrides in your ownAndroidManifest, ie:
<manifest>
<application>
- <service android:name="com.transistorsoft.locationmanager.service.TrackingService" android:foregroundServiceType="location" />
- <service android:name="com.transistorsoft.locationmanager.service.LocationRequestService" android:foregroundServiceType="location" />
</application>
</manifest>- [Android] Upgrade
android-permissionsdependency from 0.1.8 -> 2.1.6. - [iOS] Rebuild
TSLocationManager.xcframeworkwith XCode 13.3
- [Android] While testing adding 20k geofences, the Logger can cause an
OutOfMemoryerror. Define a dedicated thread executorExecutors.newFixedThreadPool(2)for posting log messages in background. - [iOS] remote event-listeners in onAppTerminate to prevent onEnabledChange event being fired in a dying app configured for
stopOnTerminate: true
- [Fixed][iOS] Regression bug in iOS SAS authorization strategy
- [Fixed][Android] Android logger defaulting to LOG_LEVEL_VERBOSE when initially launched configured for LOG_LEVEL_OFF
- [Changed][iOS] Rebuild with latest XCode
13.2.1
- [Fixed][iOS] More issues with iOS plugin 'invalidate' method. Get rid of this method. Implement startObserving, stopObserving.
- [Fixed][iOS] Backwards compatibility issue: react-native@0.66 does have this method.
No visible @interface for 'RCTEventEmitter' declares the selector 'invalidate' in RNBackgroundGeolocation.m.
- [Fixed][Android] Android 12 behaviour changes mean that foreground-services remain running. When an Android app is terminated, the app process does not terminate (since the foreground-service is active) and
RNBackgroundGeolocationModuleremains in memory. Given that, the plugin cannot rely on registering its event-listeners in theRNBackgroundGeolocationModuleconstructor, but must perform that task when.ready()is called. This also requires resettingmReady = falsewhen theMainActivityis destroyed, so that the next time.ready()is called, the event-listeners are re-registered. - [Fixed][Android] When
.ready()is calledreset: false, thesuccesscallback was not invoked with the currentState. This bug was introduced in previousv4.4.1.
- [Added] Added a
Subscriptioninterface to Typescript API. Added helpful docs to Subscription for new event-handler subscriptions.
import BackgroundGeolocation, {
Subscription
} from "...";
.
.
.
const subscription:Subscription = BacckgroundGeolocation.onLocation(myHandler);- [Added] New
Authorization.strategy "SAS"(alternative to defaultJWT). - [Fixed] Fixed
RCTEventEmitterwarning "addListener", "removeListeners". A corresponding fix has also been released for react-native-background-fetch so be sure to update tobackground-fetch >= 4.0.4. - [Changed] Deprecated
BackgroundGeolocation.removeListener. All event-handlers now return areact-nativeSubscriptioninstance containing a.remove()method. You will keep track of your ownsubscriptioninstances and call.remove()upon them when you wish to remove an event listener. Eg:
/// OLD
const onLocation = (location) => {
console.log('[onLocation');
}
BackgroundGeolocation.onLocation(onLocation);
...
// deprecated: removeListener
BackgroundGeolocation.removeListener('location', onLocation);
/// NEW: capture returned subscription instance.
const onLocationSubscription = BackgroundGeolocation.onLocation(onLocation);
...
// Removing an event-listener.
onLocationSubscription.remove();- [Added][Android] Implement new Android 12 "reduced accuracy" mechanism
requestTemporaryFullAccuracy. - [Fixed][iOS]
Authorization.refreshPayload refreshTokenwas not performing a String replace on the{refreshToken}template, instead over-writing the entire string. Eg: if provided with'refresh_token': 'Bearer {refreshToken},Bearerwould be over-written and replaced with only the refresh-token. - [Fixed][Android] Fixed crash reported by Huawei device, where verticalAccuracy returns NaN.
- [Fixed][iOS] add config change listeners for
heartbeatIntervalandpreventSuspendto dynamically update interval when changed withsetConfig. - [Fixed][Android] Add
accuracyAuthorizationparam to event data provided toonProviderChangeevent. - [Changed][Android] Update Android default
okhttpversion to3.12.13. - [Changed][Android] Update Android
eventbusversion to3.2.0. - [Changed][Android] Update Android
android-permissionsto import from MavenCentral instead of deprecatedjCenter. - [Fixed][Android] Fix an edge-case requesting motion permission. If
getCurrentPosition()is executed before.start(), the Android SDK fails to request motion permission.
- [Changed] Build iOS TSLocationManager.xcframework with XCode 12.4 instead of 12.5
- [Fixed][iOS] Reports 2 reports of iOS crash
NSInvalidArgumentException (TSLocation.m line 178)with iOS 14 .x. Wrap JSON serialization in @try/@catch block. iOS JSON serialization docs state the supplied NSError err or ref should report problems but it seems this is only "sometimes" now.
- [Changed]
Config.authorizationwill perform regexp on the received response, searching for keys such asaccessToken,access_token,refreshToken,refresh_token. - [Fixed] Typescript definition for interface
HeadlessEventwas missingtimeout: booleanattribute. Thanks @mikehardy. - [Added] Add typescript constants for plugin events, eg:
BackgroundGeolocation.EVENT_MOTIONCHANGE.
- [Fixed][iOS]
"OBJC_IVAR$_DDLogMessage._tag". CocoaLumberjack pushed a breaking change to 3.7.1 on 04/08. Pins CocoaLumberjack@3.7.0
- [Changed] Re-generate docs with latest typedoc. The docs search feature now actually works.
- [Changed][iOS] Update
pod CocoaLumberjackto latest~> 3.7.0.
- [Changed][iOS] Simply apply a cocoapods version constraint of
1.10.0in podspec.
- [Changed][iOS] Migrate
TSLocationManager.frameworkto new.xcframeworkfor MacCatalyst support with new Apple silcon.
iOS' new .xcframework requires cocoapods >= 1.10+:
$ pod --version
// if < 1.10.0
$ sudo gem install cocoapods$ yarn add react-native-background-fetch@4.0.1- [Fixed][iOS]
startOnBoot: falsewas not being respected. - [Fixed][Android] If multiple simultaneous calls to
getCurrentPositionare executed, the location permission handler could hang and not return, causing neithergetCurrentPositionrequest to execute. - [Changed] Remove
Config.encryptfeature. This feature has always been flagging a Security Issue with Google Play Console and now the iOSTSLocationManageris being flagged for a virus by Avast MacOS:Pirrit-CS[PUP]. This seems to be a false-positive due to importing RNCryptor package. - [Fixed][Android] If
stopAfterElapsedMinuteswas configured with a value greater-thanstopTimeout, the event would fail to fire.
- [Fixed][iOS] Fix issue with iOS buffer-timer with requestPermission. Could execute callback twice.
- [Fixed][iOS] When requesting
WhenInUselocation permission, if user grants "Allow Once" then you attempt to upgrade toAlways, iOS simply does nothing and therequestPermissioncallback would not be called. Implemented a500msbuffer timer to detect if the iOS showed a system dialog (signalled by the firing ofWillResignActivelife-cycle notification). If the app does notWillResignActive, the buffer timer will fire, causing the callback torequestPermissionto fire. - [Fixed][Android] Issue with
requestPermissionnot showingbackgroundPermissionRationaledialog ontargetSdkVersion 29when usinglocationAuthorizationRequest: 'WhenInUse'followed by upgrade toAlways. - [Added] Added two new
Location.coordsattributesspeed_accuracyandheading_accuracy. - [Fixed][iOS] fix bug providing wrong Array of records to
syncmethod when no HTTP service is configured. - [Fixed][Android] Add extra logic for
isMainActivityActiveto detect whenTSLocationManagerActivityis active.
- [Fixed][Android]
isMainActivityActivereported incorrect results for Android apps configured with "product flavors". This would cause the SDK to fail to recognize app is in "headless" state and fail to transmit headless events. - [Added][Android]
Location.coords.altitude_accuracywas not being returned. - [Added][Android] Android 11,
targetSdkVersion 30support for new Android background location permission with newConfig.backgroundLocationRationale. Android 11 has changed location authorization and no longer offers the[Allow all the time]button on the location authorization dialog. Instead, Android now offers a hook to present a custom dialog to the user where you will explain exactly why you require "Allow all the time" location permission. This dialog can forward the user directly to your application's Location Permissions screen, where the user must explicity authorize[Allow all the time]. The Background Geolocation SDK will present this dialog, which can be customized withConfig.backgroundPermissionRationale.
BackgroundGeolocation.ready({
locationAuthorizationRequest: 'Always',
backgroundPermissionRationale: {
title: "Allow access to this device's location in the background?",
message: "In order to allow X, Y and Z in the background, please enable 'Allow all the time' permission",
positiveAction: "Change to Allow all the time",
negativeAction: "Cancel"
}
});- [Fixed][iOS] Add intelligence to iOS preventSuspend logic to determine distance from stationaryLocation using configured stationaryRadius rather than calculated based upon accuracy of stationaryLocation. If a stationaryLocation were recorded having a poor accuracy (eg: 1000), the device would have to walk at least 1000 meters before preventSuspend would engage tracking-state.
- [Fixed][Android] Android LocationRequestService, used for getCurrentPosition and motionChange position, could remain running after entering stationary state if a LocationAvailability event was received before the service was shut down.
- [Fixed][iOS] Ignore didChangeAuthorizationStatus events when disabled and no requestPermissionCallback exists. The plugin could possibly respond to 3rd-party permission plugin events.
- [Added] Huawei-specific implementation for method isPowerSaveMode. Was always returning true.
- [Changed] Remove unnecessary android.exported on several AndroidManifest elements.
- [Added][iOS] iOS 14 introduces a new switch on the initial location authorization dialog, allowing the user to "disable precise location". In support of this, a new method
BackgroundGeolocation.requestTemporaryFullAccuracyhas been added for requesting the user enable "temporary high accuracy" (until the next launch of your app), in addition to a new attributeProviderChangeEvent.accuracyAuthorizationfor learning its state in the eventonProviderChange:
BackgroundGeolocation.onProviderChange((event) => {
print("[providerchange]", event);
// Did the user disable precise locadtion in iOS 14+?
if (event.accuracyAuthorization == BackgroundGeolocation.ACCURACY_AUTHORIZATION_REDUCED) {
// Supply "Purpose" key from Info.plist as 1st argument.
BackgroundGeolocation.requestTemporaryFullAccuracy("DemoPurpose").then((accuracyAuthorization) => {
if (accuracyAuthorization == BackgroundGeolocation.ACCURACY_AUTHORIZATION_FULL) {
console.log("[requestTemporaryFullAccuracy] GRANTED:", accuracyAuthorization);
} else {
console.log("[requestTemporaryFullAccuracy] DENIED:", accuracyAuthorization);
}
}).catch((error) => {
console.log("[requestTemporaryFullAccuracy] FAILED TO SHOW DIALOG:", error);
});
}
}These changes are fully compatible with Android, which will always return BackgroundGeolocation.ACCURACY_AUTHORIZATION_FULL
- [Added][Android] Add
onChangelistener forConfig.locationAuthorizationRequestto request location-authorization. - [Changed][iOS] If
locationAuthorizationRequest == 'WhenInUse'and the user has granted the higher level ofAlwaysauthorization, do not showlocationAuthorizationAlert. - [Changed][iOS] When
locationAuthorizationRequest: 'Always', the SDK will now initially requestWhenInUsefollowed immediately with another request forAlways, rather than having to wait an unknown length of time for iOS to show the authorization upgrade dialog: - [Added][iOS] Apple has changed the behaviour of location authorization — if an app initially requests
When In Uselocation authorization then later requestsAlwaysauthorization, iOS will immediately show the authorization upgrade dialog ([Keep using When in Use] /[Change to Always allow]).
Example
componentDidMount() {
BackgroundGeolocation.ready({
locationAuthorizationRequest: 'WhenInUse',
.
.
.
});
}
async onClickStartTracking() {
await BackgroundGeolocation.start();
//
// some time later -- could be immediately after, hours later, days later, etc.
//
// Simply update `locationAuthorizationRequest` to "Always" -- the SDK will cause iOS to automatically show the authorization upgrade dialog.
BackgroundGeolocation.setConfig({
locationAuthorizationRequest: 'Always'
});
}- [Fixed][iOS] when
getCurrentPositionis provided withextras, thoseextrasoverwrite any configuredConfig.extrasrather than merging. - [Fixed][Android] When cancelling Alarms, use
FLAG_UPDATE_CURRENTinstead ofFLAG_CANCEL_CURRENT-- there are reports of older Samsung devices failing to garbadge-collect Alarms, causing the number of alarms to exceed maximum 500, generating an exception. [Fixed][Android] ModifyisMainActivityActivecode to look specifically forMainActivityinstead of any activity. Some apps might use their own custom activity during headless operation.
- [Fixed][iOS] Geofence
EXITsometimes not firing when usingnotifyOnDwell. - [Changed][Android] Refactor geofencing-only mode to not initiate "Infinite Geofencing" when the total number of added geofences is
< 99(the maximum number of simultaneous geofences that can be monitored on Android). This prevents the SDK from periodically requesting location to query "geofences withingeofenceProximityRadius". iOS already has this behaviour (where its maximum simultaneous geofences is19). - [Fixed][iOS] When using
#readywithreset: true(the default), andautoSync: false, the SDK could initiate HTTP service if any records exist within plugin's SQLite database, sincereset: truecausesautoSync: truefor a fraction of a millisecond, initiating the HTTP Service. - [Fixed][Android]
⚠️ com.android.tools.build:gradle:4.0.0no longer allows "direct local aar dependencies". The Android Setup now requires a custommaven urlto be added to your app's rootandroid/build.gradle:
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
+ maven {
+ // Required for react-native-background-geolocation
+ url("${project(':react-native-background-geolocation-android').projectDir}/libs")
+ }
+ maven {
+ // Required for react-native-background-fetch
+ url("${project(':react-native-background-fetch').projectDir}/libs")
+ }
+ }
}- [Fixed][Android]
onConnectivityChangecan report incorrect value forenabledwhen toggling between Wifi Off / Airplane mode. - [Added][Android] New Config option
Notification.sticky(defaultfalse) for allowing the Android foreground-service notification to be always shown. The default behavior is the only show the notification when the SDK is in the moving state, but Some developers have expressed the need to provide full disclosure to their users when the SDK is enabled, regardless if the device is stationary with location-services OFF. - [Added] Support for providing a native "beforeInsert" block in iOS
AppDelegate.mand AndroidMainApplication.java. The returned object will be inserted into the SDK's SQLite database and uploaded to yourConfig.url. iOSAppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
.
.
.
// [OPTIONAL] This block is called before a location is inserted into the background_geolocation SQLite database.
// - The returned NSDictionary will be inserted.
// - If you return nil, no record will be inserted.
TSLocationManager *bgGeo = [TSLocationManager sharedInstance];
bgGeo.beforeInsertBlock = ^NSDictionary *(TSLocation *tsLocation) {
CLLocation *location = tsLocation.location;
NSLog(@"[beforeInsertBlock] %@: %@", tsLocation.uuid, location);
// Return a custom schema or nil to cancel SQLite insert.
return @{
@"lat": @(location.coordinate.latitude),
@"lng": @(location.coordinate.longitude),
@"battery": @{
@"level": tsLocation.batteryLevel,
@"is_charging": @(tsLocation.batteryIsCharging)
}
};
};
return YES;
}Android MainApplication.java
public class MainApplication extends Application implements ReactApplication {
@Override
public void onCreate() {
super.onCreate();
.
.
.
// [OPTIONAL] This block is called before a location is inserted into the background_geolocation SQLite database.
// - The returned NSDictionary will be inserted.
// - If you return nil, no record will be inserted.
BackgroundGeolocation.getInstance(this).setBeforeInsertBlock(new TSBeforeInsertBlock() {
@Override
public JSONObject onBeforeInsert(TSLocation tsLocation) {
Location location = tsLocation.getLocation();
JSONObject json = new JSONObject();
JSONObject battery = new JSONObject();
try {
json.put("lat", location.getLatitude());
json.put("lng", location.getLongitude());
battery.put("level", tsLocation.getBatteryLevel());
battery.put("is_charging", tsLocation.getBatteryIsCharging());
json.put("battery", battery);
return json;
} catch (JSONException e) {
e.printStackTrace();
return null;
}
}
});
}
}- [Fixed][Android]
onGeofenceevent-handler fails to be fired whenmaxRecordsToPersist: 0. - [Fixed][Android]
requestPermissionmethod was always returningAUTHORIZATION_STATUS_ALWAYSeven when When in Use was selected. - [Fixed][Android] Android plugin was importing an
androidxdependencylocalbroadcastmanagerwithout first checking ifuseAndroidXwas set totrue. - [Fixed][iOS] When using
disableStopDetection: truewithpausesLocationUpdatesAutomatically: true, theCLLocationManagerDelegate didPauseLocationUpdatesthemotionchangeevent reportedisMoving: true. - [Fixed][Android] Ensure location failure callback is executed on main-thread.
- [Changed][Android] Gradle import
tslocationmanager.aarusingapirather thanimplementationin order to allow overrides inAndroidManifest.xml. - [Fixed][iOS] When upgrading from a version previous to
3.4.0, if any records exist within plugin's SQLite database, those records could fail to be properly migrated to new schema. - [Added] New method
BackgroundGeolocation.destroyLocation(uuid)for destroying a single location byLocation.uuid. - [Fixed] Allow firebase-adapter to validate license flavors on same key (eg: .development, .staging).
- [Fixed] iOS geofence listeners on
onGeofencemethod could possibly fail to be called when a geofence event causes iOS to re-launch the app in the background (this would not prevent the plugin posting the geofence event to yourConfig.url, only a failure of the JavascriptonGeofenceto be fired). - [Changed] Android library
tslocationmanager.aaris now compiled usingandroidx. For backwards-compatibility with those how haven't migrated toandroidX, a reverse-jetified build is included. Usage is detected automatically based uponandroid.useAndroidXin one'sgradle.properties.
- [Added] [Android] Add new
Config.motionTriggerDelay (milliseconds)for preventing false-positive triggering of location-tracking (while walking around one's house, for example). If the motion API triggers back tostillbeforemotionTriggerDelayexpires, triggering to the moving state will be cancelled. - [Fixed] Address issue with rare reports of iOS crashing with error referencing
SOMotionDetector.m. - [Fixed] Odometer issue with Android/iOS: Do not persist
lastOdometerLocationwhen plugin is disabled. - [Added] iOS
Config.showsBackgroundLocationIndicator, A Boolean indicating whether the status bar changes its appearance when an app uses location services in the background. - [Changed]
cordova-plugin-background-fetchdependency updated to3.xwith new iOS 13BGTaskSchedulerAPI. - [Fixed]
synchronizemethods inTSLocationManagerto address Android NPE related tobuildTSLocation. - [Fixed] Typescript declaration for
Location.isMovingshould beLocation.is_moving. - [Fixed] iOS: Bug in
accessTokenRegExp in Authorization token-refresh handler. - [Fixed] Part of the raw Javascript API contained typescript, which would cause an error on older mobile browser versions.
- [Added] Implement four new RPC commands
addGeofence,removeGeofence,addGeofences,removeGeofences. Document available RPC commands in "HttpGuide". - [Fixed] Android: launch-Intent for foreground-service notification was causing notification-click to re-launch the Activity rather than show existing.
- [Changed] Android: Modify behaviour of geofences-only mode to not periodically request location-updates. Will use a stationary-geofence of radius geofenceProximityRadius/2 as a trigger to re-evaluate geofences in proximity.
- [Changed] iOS: Prefix FMDB method-names
databasePool->ts_databasePoolafter reports of apps being falsely rejected by Apple for "private API usage". - [Fixed] Android: Ensure that
location.hasSpeed()before attempting to use it for distanceFilter elasticity calculations. There was a report of a Device returningNanfor speed. - [Fixed] Android: Do not throttle http requests after http connect failure when configured with
maxRecordsToPersist. - [Fixed] Android: Respect
disableLocationAuthorizationAlertfor all cases, includinggetCurrentPosition. - [Changed] Android: Modify behaviour of geofences-only mode to not periodically request location-updates. Will use a stationary-geofence of radius geofenceProximityRadius/2 as a trigger to re-evaluate geofences in proximity.
- [Changed] Authorization
refreshUrlwill post as application/x-www-form-urlencoded instead of form/multipart - [Changed] iOS geofencing mode will not engage Significant Location Changes API when total geofence count <= 18 in order to prevent new iOS 13 "Location summary" popup from showing frequent location access.
- [Fixed] Android: Add hack for older devices to fix "GPS Week Rollover" bug where incorrect timestamp is recorded from GPS (typically where year is older by 20 years).
- [Fixed] When determining geofences within
geofenceProximityRadius, add thelocation.accuracyas a buffer against low-accuracy locations. - [Changed] Increase default
geofenceProximityRadius: 2000.
- [Fixed] iOS crash when launching first time
-[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: authorization)' - [Changed] Remove Android warning
In order to enable encryption, you must provide the com.transistorsoft.locationmanager.ENCRYPTION_PASSWORDwhen usingencrypt: false. - [Fixed] Added headless implementation for
geofenceschangeevent.
- [Fixed] Android bug rendering
Authorization.toJsonwhen noConfig.authorizationdefined.
- [Added] New
Config.authorizationoption for automated authorization-token support. If the SDK receives an HTTP response status401 Unauthorizedand you've provided anauthorizationconfig, the plugin will automatically send a request to your configuredrefreshUrlto request a new token. The SDK will take care of adding the requiredAuthorizationHTTP header withBearer accessToken. In the past, one would manage token-refresh by listening to the SDK'sonHttplistener for HTTP401. This can now all be managed by the SDK by providing aConfig.authorization. - [Added] Implemented strong encryption support via
Config.encrypt. When enabled, the SDK will encrypt location data in its SQLite datbase, as well as the payload in HTTP requests. See API docsConfig.encryptfor more information, including the configuration of encryption password. - [Added] New JSON Web Token API for the Demo server at http://tracker.transistorsoft.com. It's now easier than ever to configure the plugin to post to the demo server. See API docs
Config.transistorAuthorizationToken. The old method usingBackgroundGeolocation.transistorTrackerParamsis now deprecated. - [Added] New
DeviceInfomodule for providing simple device-info (model,manufacturer,version,platform).
- [Fixed] Android bug in params order to getLog. Thanks @mikehardy.
- [Fixed] Typo in Javascript API callback in
destroyLog. Thanks @mikehardy.
- [Fixed] Android NPE
Caused by: java.lang.NullPointerException:
at com.transistorsoft.locationmanager.service.TrackingService.b (TrackingService.java:172)
at com.transistorsoft.locationmanager.service.TrackingService.onStartCommand (TrackingService.java:135)
- [Added] new
uploadLogfeature for uploading logs directly to a server. This is an alternative toemailLog. - [Changed] Migrated logging methods
getLog,destroyLog,emailLogto newLoggermodule available atBackgroundGeolocation.logger. See docs for more information. Existing log methods onBackgroundGeolocationare now@deprecated. - [Changed] All logging methods (
getLog,emailLoganduploadLog) now accept an optionalSQLQuery. Eg:
let query = {
start: Date.parse('2019-10-23 09:00'),
end: Date.parse('2019-10-23 19:00'),
limit: 1000,
order: Logger.ORDER_ASC
};
let Logger = BackgroundGeolocation.logger;
let log = await Logger.getLog(query)
Logger.emailLog('foo@bar.com', query);
Logger.uploadLoad('http://your.server.com/logs', query);- [Fixed] Android: Fixed issue executing
#changePaceimmediately after#start. - [Fixed] Android: Add guard against NPR in
calculateMedianAccuracy - [Added] Add new Geofencing methods:
#getGeofence(identifier)and#geofenceExists(identifier). - [Fixed] iOS issue using
disableMotionActivityUpdates: falsewithuseSignificantChangesOnly: trueandreset: true. Plugin will accidentally ask for Motion Permission. Fixes #1992. - [Fixed] Resolved a number of Android issues exposed by booting the app in StrictMode. This should definitely help alleviate ANR issues related to
Context.startForegroundService. - [Added] Android now supports
disableMotionActivityUpdatesfor Android 10 which now requires run-time permission for "Physical Activity". Setting totruewill not ask user for this permission. The plugin will fallback to using the "stationary geofence" triggering, like iOS. - [Changed] Android: Ensure all code that accesses the database is performed in background-threads, including all logging (addresses
Context.startForegroundServiceANR issue). - [Changed] Android: Ensure all geofence event-handling is performed in background-threads (addresses
Context.startForegroundServiceANR issue). - [Added] Android: implement logic to handle operation without Motion API on Android 10. v3 has always used a "stationary geofence" like iOS as a fail-safe, but this is now crucial for Android 10 which now requires run-time permission for "Physical Activity". For those users who [Deny] this permission, Android will trigger tracking in a manner similar to iOS (ie: requiring movement of about 200 meters). This also requires handling to detect when the device has become stationary.
- [Changed] Android: move more location-handling code into background-threads to help mitigate against ANR referencing
Context.startForegroundService - [Changed] Android: If BackgroundGeolocation adapter is instantiated headless and is enabled, force ActivityRecognitionService to start.
- [Added] Add
mocktolocationTemplatedata. - [Changed] Android now hosts its own
proguard-rules.pro. See Android setup docs for new integration of plugin's required Proguard Rules into your app. Replace@availablemacro withSYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO. - [Fixed] iOS 13 preventSuspend was not working with iOS 13. iOS has once again decreased the max time for UIApplication beginBackgroundTask from 180s down to 30s.
- [Changed] Upgrade
android-logbackdependency to2.0.0 - [Changed] Android: move some plugin initialization into background-threads (eg:
performLogCleanup) to help mitigate against ANR "Context.startForegroundServicedid not then callService.startForeground". - [Fixed] Android Initial headless events can be missed when app booted due to motion transition event.
- [Fixed] Android crash with EventBus
Subscriber already registered error. - [Fixed] iOS
Crash: [TSHttpService postBatch:error:] + 6335064 (TSHttpService.m:253) - [Changed] Minor changes to
build.gradle: fetchminSdkVersionfromextinstead of hard-coding, useimplementationwithreactinstead ofcompileOnly.
- [Added] iOS 13 support.
- [Added] Auto-linking support. Do not use
react-native linkanymore. See the Setup docs for Android and iOS. Before installing3.2.0, firstreact-native unlinkbothbackground-geolocationandbackground-fetch.
react-native-background-geolocation < 3.2.0 installed into react-native >= 0.60, you should first unlink your previous version as react-native link is no longer required.
$ react-native unlink react-native-background-geolocation- [Fixed] Android Geofence
DWELLtransition (notifyOnDwell: true) not firing. - [Fixed] iOS
logMaxDayswas hard-coded to7; Config option not being respected. - [Added] Android
Qsupport (API 29) with new iOS-like location permission model which now requestsWhen In UseorAlways. Android now supports the config optionlocationAuthorizationRequestwhich was traditionally iOS-only. Also, Android Q now requires runtime permission from user forACTIVITY_RECOGNITION. - [Changed] Another Android tweak to mitigate against error
Context.startForegroundService() did not then call Service.startForeground(). - [Added] Add new Android gradle config parameter
appCompatVersionto replacesupportLibVersionfor better AndroidX compatibility. IfappCompatVersionis not found, the plugin's gradle file falls back tosupportLibVersion. For react-native@0.60, you should start using the newappCompatVersion.
[Changed] Implement react-native.config.js ahead of deprecated rnpm config.
- [Fixed] Added logic to detect when app is configured to use AndroidX dependencies, adjusting the required
appcompatdependency accordingly. If the gradle configext.supportLibVersioncorresponds to an AndroidX version (eg:1.0.0), the plugin assumes AndroidX. - [Changed] Remove
cocoa-lumberjackas a dependency sincereact-native >= 0.60.0iOS apps are all Cocoapods now. There's no longer a need for this dependency now since the plugin's podspec can importCocoaLumberjackpod directly. This is going to cause short-term pain for those using< 0.60.0, forcing one to manually installcocao-lumberjack. - [Fixed] iOS / Android issues with odometer and
getCurrentPositionwhen used withmaximumAgeconstraint. Incorrect, old location was being returned instead of latest available. - [Fixed] Some Android methods were executing the callback in background-thread, exposed when using flutter dev channel (
#insertLocation,#getLocations,#getGeofences,#sync). - [Fixed] Add
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)toDeviceSettingsrequest for Android 9 compatibility. - [Changed] Tweaks to Android services code to help guard against error
Context.startForegroundService() did not then call Service.startForeground(). - [Fixed] iOS manual
synccrash in simulator while executing callback when error response is returned from server.
- [Fixed] iOS & Android: Odometer issues: clear odometer reference location on
#stop,#startGeofences. - [Fixed] Odometer issues: Android must persist its odometer reference location since the foreground-service is no longer long-lived and the app may be terminated between motionchange events.
- [Fixed] Return
Service.START_REDELIVER_INTENTfromHeartbeatServiceto preventnullIntent being delivered toHeartbeatService, causing a crash. - [Added] Implement Android LocationSettingsRequest. Determines if device settings is currently configured according to the plugin's desired-settings (eg: gps enabled, location-services enabled). If the device settings differs, an automatic dialog will perform the required settings changes automatically when user clicks [OK].
- [Fixed] Android
triggerActivitieswas not implemented refactor of3.x.
- [Changed] Bump
CocoaLumberjackdependency to~> 3.5.1. - [Fixed] Android
destroyLocationscallback was being executed in background-thread. - [Fixed] When Android geofence API receives a
GEOFENCE_NOT_AVAILABLEerror (can occur if Wifi is disabled), geofences must be re-registered. - [Fixed] Android
Config.disableStopDetectionwas not implemented. - [Added] Add new Android Config options
scheduleUseAlarmManagerfor forcing scheduler to useAlarmManagerinsead ofJobServicefor more precise scheduling.
- [Changed] Rollback
android-permissionsversion back to0.1.8. It relies onsupport-annotations@28. This isn't a problem if one simply upgrades theirtargetSdkVersionbut the support calls aren't worth the hassle, since the latest version doesn't offer anything the plugin needs.
- [Fixed] iOS: changing
pauseslocationUpdatesAutomaticallywas not being applied. - [Changed]
resetparameter provided to#readyhas now been default totrue. This causes too many support issues for people using the plugin the first time. - [Fixed] Android threading issue where 2 distinct
SingleLocationRequestwere issued the same id. This could result in the foreground service quickly starting/stopping untillocationTimeoutexpired. - [Fixed] Android issue where geofences could fail to query for new geofences-in-proximity after a restart.
- [Fixed] Android issues re-booting device with location-services disabled or location-authorization revoked.
- [Added] Implement support for Custom Android Notification Layouts.
- [Fixed] Android bug where service repeatedly starts/stops after rebooting the device with plugin in moving state.
- [Fixed] Android headless
heartbeatevents were failing (incorrectContextwas supplied to the event).
- [Fixed] Windows bug in new
react-native linkscript. - [Fixed] Android scheduler bug. When app is terminated & restarted during a scheduled ON period, tracking-service does not restart.
- [Added] Added android implementation for
react-native linkscript to automatically add the requiredmaven urlandext.googlePlayServicesLocationVersion.
- [Changed] Promote
3.0.0-rc.5to3.0.0.
- [Fixed] Android: Another
NullPointerExceptionwithBundle#getExtras.
- [Fixed] Android
NullPointerExceptionwithBundle#getExtras. - [Fixed] Android not persisting
providerchangelocation when location-services re-enabled.
- [Fixed] An Android foreground-service is launched on first install and fails to stop.
- [Changed] Remove unused Gradle function.
[Changed] The license format has changed. New 3.0.0 licenses are now available for customers in the product dashboard.
- For versions
< 3.0.0, use old license keys. - For versions
>= 3.0.0, use new license keys.
- For those minifying their generated Android APK by enabling the following in your
app/build.gradle,
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = true
You must add the following line to your proguard-rules.pro:
-keepnames class com.facebook.react.ReactActivity
See the full required Proguard config in the Android Setup Doc.
- [Fixed] Logic bugs in MotionActivity triggering between stationary / moving states.
- [Fixed] Remove iOS react-native
#includecruftif __has_include(“XXX.h”)for support RN libs during their transition to using Frameworks. Fixes #669. - [Fixed] iOS crash with configured
schedule:index 2 beyond bounds [0 .. 1]' was thrown. Fixes #666. - [Fixed]
NullPointerException in logger. References #661.
- [Added] Android implementation for
useSignificantChangesOnlyConfig option. Will request Android locations without the persistent foreground service. You will receive location updates only a few times per hour:
-
[Added] Android now implements a "stationary geofence", just like iOS. It currently acts as a secondary triggering mechanism along with the current motion-activity API. You will hear the "zap" sound effect when it triggers. This also has the fortunate consequence of allowing mock-location apps (eg: Lockito) of being able to trigger tracking automatically.
-
[Added] The SDK detects mock locations and skips trigging the
stopTimeoutsystem, improving location simulation workflow. -
[Added] Android-only Config option
geofenceModeHighAccuracyfor more control over geofence triggering responsiveness. Runs a foreground-service during geofences-only mode (#startGeofences). This will, of course, consume more power.
await BackgroundGeolocation.ready({
geofenceModeHighAccuracy: true,
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_MEDIUM,
locationUpdateInterval: 5000,
distanceFilter: 50
));
BackgroundGeolocation.startGeofences();- Transition events are delayed in favour of lower power consumption.
- Transition events are nearly instantaneous at the cost of higher power consumption.
- [Added] Android implementation of
startBackgroundTask/stopBackgroundTask.
int taskId = await BackgroundGeolocation.startBackgroundTask();
// Do any work you like -- it's guaranteed to run, regardless of background/terminated.
// Your task has exactly 30s to do work before the service auto-stops itself.
getDataFromServer('https://foo.bar.com').then((result) => {
// Be sure to always signal completion of your taskId.
BackgroundGeolocation.stopBackgroundTask(taskId);
}).catch((error) => {
// Be sure to always signal completion of your taskId.
BackgroundGeolocation.stopBackgroundTask(taskId);
});Logging for Android background-tasks looks like this (when you see an hourglass, a foreground-service is active)
[BackgroundTaskManager onStartJob] ⏳ startBackgroundTask: 6
.
.
.
[BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 6
- [Added] New custom Android debug sound FX. See the Config.debug for a new decription of iOS / Android sound FX including a media player to play each.
tslocationmanager.aar. These assets can easily be stripped in your release builds by adding the following gradle task to your app/build.gradle (I'm working on an automated solution within the context of the plugin's build.gradle; so far, no luck). Big thanks to @mikehardy.
/**
* Purge Background Geolocation debug sounds from release build.
*/
def purgeBackgroundGeolocationDebugResources(applicationVariants) {
applicationVariants.all { variant ->
if (variant.buildType.name == 'release') {
variant.mergeResources.doLast {
delete(fileTree(dir: variant.mergeResources.outputDir, includes: ['raw_tslocationmanager*']))
}
}
}
}
android {
//Remove debug sounds from BackgroundGeolocation plugin
purgeBackgroundGeolocationDebugResources(applicationVariants)
compileSdkVersion rootProject.ext.compileSdkVersion
.
.
.
}- [Changed] Removed Android config option
activityRecognitionIntervalandminimumActivityRecognitionConfidence. The addition of the new "stationary geofence" for Android should alleviate issues with poor devices failing to initiate tracking. The Android SDK now uses the more modern ActivityTransistionClient API which is a higher level wrapper for the traditional ActivityReconitionClient.AcitvityTransitionClientdoes not accept a pollinginterval, thusactiivtyRecognitionIntervalis now unused. Also,ActivityTransitionClientemits similaron_foot,in_vehicleevents but no longer provides aconfidence, thusconfidenceis now reported always as100. If you've been implementing your own custom triggering logic based uponconfidence, it's now pointless. TheActivityTransitionClientwill open doors for new features based upon transitions between activity states.
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🔴 EXIT: walking
╟─ 🎾 ENTER: still
╚═════════════════════════════════════════════
- [Changed] Update
android-permissionsdependency to0.1.8.
- [Fixed] Logic bugs in MotionActivity triggering between stationary / moving states.
- [Added] Android-only Config option
geofenceModeHighAccuracyfor more control over geofence triggering accuracy. Runs a foreground-service during geofences-only mode (#startGeofences). - [Added] Android implementation for
useSignificantChangesOnlyConfig option. Will request Android locations without the persistent foreground service. You will receive location updates only a few times per hour. - [Changed] Update
android-permissionsdependency to0.1.8.
- [Fixed] Android bug in Config dirty-fields mechanism.
- [Changed] Improve trackingMode state-changes between location -> geofences-only.
- [Changed] Improvements to geofences-only tracking.
- [Changed] Improvements to stationary-geofence monitoring, detecting mock locations to prevent stopTimeout triggering.
- [Changed] Tweaking stationary region monitoring.
- [Changed] Tweaking bad vendor detection to force stopTimeout timer when device is stationary for long periods and motion api hasn't respon ded.
-
[Changed] Major refactor of Android Service architecture. The SDK no longer requires a foreground-service active at all times. The foreground-service (and cooresponding persistent notification) will only be active while the SDK is in the moving state. No breaking dart api changes.
-
[Changed] Improved Android debug notifications.
-
[Added] Added new Config options
persistModefor specifying exactly which events get persisted: location | geofence | all | none. -
[Added] Experimental Android-only Config option
speedJumpFilter (default 300 meters/second)for detecting location anomalies. The plugin will measure the distance and apparent speed of the current location relative to last location. If the apparent speed is >speedJumpFilter, the location will be ignored. Some users, particularly in Australia, curiously, have had locations suddenly jump hundreds of kilometers away, into the ocean. -
[Changed] iOS and Android will not perform odometer updates when the calculated distance is less than the average accuracy of the current and previous location. This is to prevent small odometer changes when the device is lingering around the same position.
-
[Fixed] Added Android gradle dependency
appcompat-v7 -
[Fixed] Minor change to Android
HeadlessTaskto fix possible issue withLooper. -
[Added] New
DeviceSettingsAPI for redirecting user to Android Settings screens, including vendor-specific screens (eg: Huawei, OnePlus, Xiaomi, etc). This is an attempt to help direct the user to appropriate device-settings screens for poor Android vendors as detailed in the site Don't kill my app. -
[Added]
schedulecan now be configured to optionally execute geofences-only mode (ie:#startGeofences) per schedule entry. Seescheduledocs. -
[Changed] Update Gradle config to use
implementationinstead of deprecatedcompile -
[BREAKING] Change Gradle
extconfiguration propertygooglePlayServicesVersion->googlePlayServicesLocationVersion. Now that Google has decoupled all their libraries,play-services:locationnow has its own version, independant of all other libs.
android/build.gradle:
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "28.0.0"
- googlePlayServicesVersion = "16.0.0"
+ googlePlayServicesLocationVersion = "16.0.0"
}
}-
[Changed] Android Service: Return
START_STICKYinstead ofSTART_REDELIVER_INTENT. -
[Changed] Android:
setShowBadge(false)on AndroidNotificationChannel. Some users reporting that Android shows a badge-count on app icon when service is started / stopped. -
[Fixed] Android
extrasprovided towatchPositionwere not being appended to location data. -
[Fixed] Android NPE in
watchPosition -
[Added] Added method
getProviderStatefor querying current state of location-services. -
[Added] Added method
requestPermissionfor manually requesting location-permission (#start,#getCurrentPosition,#watchPositionetc, will already automatically request permission. -
[Changed] Upgrade Android logger dependency to latest version (
logback). -
[Fixed] Prevent Android foreground-service from auto-starting when location permission is revoked via Settings screen.
-
[Fixed] NPE in Android HTTP Service when manual sync is called. Probably a threading issue with multiple sync operations executed simultaneously.
- [Added] Android SDK 28 requires new permission to use foreground-service.
- [Fixed] Do not calculate odometer with geofence events. Android geofence event's location timestamp does not correspond with the actual time the geofence fires since Android is performing some heuristics in the background to ensure the potential geofence event is not a false positive. The actual geofence event can fire some minutes in the future (ie: the location timestamp will be some minutues in the past). Using geofence location in odometer calculations will corrupt the odometer value.
- [Fixed] Android could not dynamically update the
locationTemplate/geofenceTemplatewithout#stopand application restart. - [Fixed] Android
startGeofencesafter revoking & re-granting permission would fail to launch the plugin's Service. - [Fixed] iOS HTTP crash when using
batchSync: true. At application boot, there was a threading issue if the server returned an HTTP error, multiple instances of the HTTP service could run, causing a crash.
- [Fixed] react-native link on Windows.
- [Fixed] Android
NullPointerExceptiononWatchPositionCallbackwithwatchPosition.
- [Fixed] Mistake in module-name in index.d.ts
- [Fixed] Documentation issue with method signature
getCurrentPosition. - [iOS] Catch
NSInvalidArgumentExceptionwhen decodingTSConfig. - [Fixed]
react-native linkscripts were accidentally.npmignored causing errorUnhandled 'error' eventwhen linking.
- [Added] Implement Typescript API
- [Added] Refactor documentation. Now auto-generated from Typescript api with Typedoc and served from https://transistorsoft.github.io/react-native-background-geolocation
- [Breaking] Change event-signature of
locationevent: location-errors are now received in newfailurecallback rather than separateerrorevent. Theerrorevent has been removed.
BackgroundGeolocation.onLocation((location) => {
console.log('[location] -', location);
}, (errorCode) => {
// Location errors received here.
console.log('[location] ERROR -', errorCode);
});- [Added] With the new Typescript API, it's necessary to add dedicated listener-methods for each method (in order for code-assist to work).
// Old: No code-assist for event-signature with new Typescript API
BackgroundGeolocation.on('location', (location) => {}, (error) => {});
// New: use dedicated listener-method #onLocation
BackgroundGeolocation.onLocation((location) => {}, (error) => {});
// And every other event:
BackgroundGeolocation.onMotionChange(callback);
BackgroundGeolocation.onMotionProviderChange(callback);
BackgroundGeolocation.onActivityChange(callback);
BackgroundGeolocation.onHttp(callback);
BackgroundGeolocation.onGeofence(callback);
BackgroundGeolocation.onGeofencesChange(callback);
BackgroundGeolocation.onSchedule(callback);
BackgroundGeolocation.onConnectivityChange(callback);
BackgroundGeolocation.onPowerSaveChange(callback);
BackgroundGeolocation.onEnabledChange(callback);- [Breaking] Change event-signature of
enabledchangeevent to return simplebooleaninstead of{enabled: true}: It was pointless to return an{}for this event.
// Old
BackgroundGeolocation.onEnabledChange((enabledChangeEvent) => {
console.log('[enabledchange] -' enabledChangeEvent.enabled);
})
// New
BackgroundGeolocation.onEnabledChange((enabled) => {
console.log('[enabledchange] -' enabled);
})- [Breaking] Change signature of
#getCurrentPositionmethod: Options{}is now first argument rather than last:
// Old (Options as 3rd argument)
BackgroundGeolocation.getCurrentPosition((location) => {
console.log('[getCurrentPosition] -', location);
}, (error) => {
console.log('[getCurrentPosition] ERROR -', error);
}, { // <-- Options as 3rd argument
samples: 3,
extras: {foo: 'bar'}
})
// New (Options as 1st argument)
BackgroundGeolocation.getCurrentPosition({
samples: 3,
extras: {foo: 'bar'}
}, (location) => {
console.log('[getCurrentPosition] -', location);
}, (error) => {
console.log('[getCurrentPosition] ERROR -', error);
})- [Fixed] iOS was missing Firebase adapter hook for persisting geofences.
- [Changed] Android headless events are now posted with using
EventBusinstead ofJobScheduler. Events posted via AndroidJobSchedulerare subject to time-slicing by the OS so events could arrive late. - [Fixed] Missing
removeListenersforconnectivitychange,enabledchangeevents. - [Fixed] iOS was not calling
successcallback forremoveListeners. - [Fixed] iOS plugin was not parsing schedule in
#readyevent.
- [Fixed] iOS was missing Firebase adapter hook for persisting geofences.
- [Changed] Android headless events are now posted with using
EventBusinstead ofJobScheduler. Events posted via AndroidJobSchedulerare subject to time-slicing by the OS so events could arrive late. - [Fixed] Missing
removeListenersforconnectivitychange,enabledchangeevents. - [Fixed] iOS was not calling
successcallback forremoveListeners. - [Fixed] iOS plugin was not parsing schedule in
#readyevent.
- [Fixed] Minor error in plugin's
build.gradle.DEFAULT_BUILD_TOOLS_VERSIONwas set incorrectly.
- [Fixed] iOS scheduler not being initialized in
#readyafter reboot.
- [Fixed] Android firebase plugin bug in release build.
- [Added] New Android config-option
notificationChannelNamefor configuring the notification-channel required by the foreground-service notification. See Settings->Apps & Notificaitions->Your App->App Notifications. - [Added] Support for new Firebase Adapter
- [Added] iOS support for HTTP method
PATCH(Android already supports it). - [Fixed] Android was not using
httpTimeoutwith latestokhttp3. - [Fixed] Android issue not firing
providerchangeon boot when configured withstopOnTerminate: true - [Fixed] Android
headlessJobServiceclass could fail to be applied when upgrading from previous version. Ensure always applied. - [Fixed] Android
httpTimeoutwas not being applied to newokhttp3.Client#connectionTimeout - [Fixed] Apply recommended XCode build settings.
- [Fixed] XCode warnings 'implicity retain self in block'
- [Changed] Android Removed unnecessary attribute
android:supportsRtl="true"fromAndroidManifest - [Fixed] iOS
preventSuspendwas not working withuseSignificantChangesOnly - [Changed] iOS disable encryption on SQLite database file when "Data Protection" capability is enabled with
NSFileProtectionNoneso that plugin can continue to insert records while device is locked.
- [Fixed] Fix
react-native linkerror when iOS and npm project name are diferent. - [Fixed] iOS issue when plugin is booted in background in geofences-only mode, could engage location-tracking mode.
- [Fixed] Android
getCurrentPositionwas not respectingpersist: truewhen executed in geofences-only mode.
- [Fixed] iOS geofence exit was being ignored in a specific case where (1) geofence was configured with
notifyOnDwell: trueAND (2) the app was booted in the background due to a geofence exit event.
- [Fixed] Android bug where plugin could fail to translate iOS desiredAccuracy value to Android value, resulting in incorrect
desiredAccuracyvalue for Android, probably defaulting toDESIRED_ACCURACY_LOWEST.
- [Added] iOS config
disableLocationAuthorizationAlertfor disabling automatic location-authorization alert when location-services are disabled or user changes toggles location access (eg:Always->WhenInUse). - [Fixed] Android was not executing
#getCurrentPositionfailurecallback. - [Fixed] Fixed issue executing
#getCurrentPositionfrom Headless mode while plugin is current disabled. - [Added] Add new iOS
locationAuthorizationRequest: "Any"for allowing the plugin to operate in eitherAlwaysorWhenInUsewithout being spammed by location-authorization dialog.
- [Fixed] Android
getCurrentPositionwould not work from a HeadlessTask when the plugin was not currentlyenabled.
- [Changed] Repackage android lib
tslocationmanager.aaras a Maven Repositoroy.⚠️ Installation procedure has changed slightly. Please review Android installation docs for your chosen install method (Manual or react-native link). - [Added] Added new initialization method
#ready, desigend to replace#configure(which is now deprectated). The new#readymethod operates in the same manner as#configurewith a crucial difference -- the plugin will only apply the supplied configuration{}at the first launch of your app — thereafter, it will automatically load the last-known config from persistent storage. - [Added] Add new method
#resetfor resetting the plugin configuration to documented defaults. - [Added] Refactor Javascript API to use Promises. Only
#watchPositionand adding event-listeners with#onwill not use promises. - [Fixed] iOS issue not turning of "keepAlive" system when
#stopmethod is executed while stop-detection system is engaged. - [Added] Android will fire
providerchangeevent after the result of user location-authorization (accept/deny). The result will be available in thestatuskey of the event-object. - [Changed] Refactor native configuration system for both iOS and Android with more traditional Obj-c / Java API.
- [Changed] Create improved Obj-c / Java APIs for location-requests (
#getCurrentPosition,#watchPosition) and geofencing. - [Added] Added new event
connectivitychangefor detecting network connectivity state-changes. - [Added] Added new event
enabledchange, fired with the plugin enabled state changes. Executing#start/#stopwill cause this event to fire. This is primarily designed for use withstopAfterElapsedMinutes.
- [Fixed] Guard usage of
powersavechangeevent for iOS < 9 - [Added] Android permissions are now handled completely within
tslocationmanagerlibrary rather than within Cordova Activity. - [Fixed] iOS
emailLogissues: sanity check existence of email client, ensure we have reference to topMostUIViewController. - [Added] New Android "Headless" mechanism allowing you provide a simple custom Java class to receive all events from the plugin when your app is terminated (with
stopOnTerminate: false). The headless mechanism is enabled with new@config {Boolean} enableHeadless. See the Wiki "Headless Mode" for details. - [Fixed] iOS
getCurrentPositionwas applying entire options{}asextras. - [Fixed] iOS
watchPosition/getCurrentPosition@option persistwas being ignored when plugin was disabled (ie:#stopped). - [Fixed] Implement Android
JobSchedulerAPI for scheduler (where API_LEVEL) allows it. Will fallback to existingAlarmManagerimplementation where API_LEVEL doesn't allowJobScheduler. This fixes issues scheduler issues with strict new Android 8 background-operation rules. - [Added] Added new Android
@config {Boolean} allowIdenticalLocations [false]for overriding the default behaviour of ignoring locations which are identical to the last location. - [Added] Add iOS
CLFloorattribute tolocation.coordinatefor use in indoor-tracking when required RF hardware is present in the environment (specifies which floor the device is on).
- [Fixed] Rare issue with iOS where rapidly toggling executing
startwithchangePace(true)in the callback followed bystop, over and over again, would lock up the main thread. - [Changed] Android
GEOFENCE_INITIAL_TRIGGER_DWELLdefaulted totrue. - [Fixed]
Proguard-Ruleswere not ignoring the newLogFileProviderused for#emailLogmethod. - [Fixed] Android issue on some device where callback to
#configurewould not be executed in certain cases.
- [Fixed] Android NPE on
Settings.getForegroundService()when usingforegroundService: false - [Fixed] Android 8 error with
emailLog. Crash due toSecurityExceptionwhen writing the log-file. Fixed by implementingFileProvider(storage permissions no longer necessary). - [Fixed] iOS bug when providing non-string
#headervalues. Ensure casted to String. - [Changed] Android minimum required play-services version is
11.2.0(required for newplay-servicesAPis. Anything less and plugin will crash. - [Changed] Update Android to use new
FusedLocationProviderClientinstead of now-deprectatedFusedLocationProviderAPI. It's the same underlying play-services location API -- just with a much simpler, less error-prone interface to implement. - [Fixed] On Android, when
changePace(true)is executed while device is currentlystill(and remainsstill),stopTimeouttimer would never initiate until device movement is detected. - [Fixed] iOS manual
#syncwas not executing any callback if database was empty. - [Added] Implement new Android 8
NotificationChannelwhich is now required for displaying theforegroundServicenotification. - [Added] Android foreground-service notification now uses
id: 9942585. If you wish to interact with the foreground-service notification in native code, this is theid. - [Fixed] iOS not always firing location
failurecallback. - [Fixed] iOS was not forcing an HTTP flush on
motionchangeevent whenautoSyncThresholdwas used. - [Fixed] iOS Add sanity-check for Settings
booleantype. It was possible to corrupt the Settings when aboolean-type setting was provided with a non-boolean value (eg:{},[]). - [Fixed] Android
getStatecould cause an NPE if executed before#configure. - [Fixed] Work around iOS 11 bug with
CLLocationManager#stopMonitoringSignificantLocationChanges(SLC): When this method is called upon any singleCLLocationManagerinstance, it would cause all instances to#stopMonitoringSignificantLocationChanges. This caused problems with Scheduler evaluation, since SLC is required to periodically evaluate the schedule.
- [Added] Re-build for iOS 11, XCode 9
- [Added] Implement new
powersavechangeevent in addition toisPowerSaveModemethod for determining if OS "Power saving" mode is enabled. - [Added] New config
elasticityMultiplierfor controlling the scale ofdistanceFilterelasticity calculation. - [Fixed] Android bug not firing
scheduleJavascript listeners - [Fixed] Android crash
onGooglePlayServicesConnectdErrorwhen Google Play Services needs to be updated on device.
- [Changed] Refactor Android
onDestroymechanism attempting to solve nagging and un-reproducible null pointer exceptions. - [Added] Implement Android location permissions handling using
PermissionsAndroidAPI. You no longer need to use 3rd-party permissions module to obtain Android location permission. - [Fixed] Fixed bug not where
stopAfterElapsedMinutesis not evaluated when executing#getCurrentPosition. - [Fixed] Modifications for Android O. For now,
foregroundService: truewill be enforced when running on Android O (api 26).
- [Changed] Reference latest
react-native-background-fetchversion2.1.0 - [Added] Javascript API to plugin's logging system.
- [Fixed] Minor issue with iOS flush where multiple threads might create multiple background-tasks, leaving some unfinished.
- [Changed] Refactor iOS / Android core library event-subscription API.
- [Added] Removing single event-listeners with
#removeListener(alias#un) is snow fully supported! There will no longer be warnings "No listeners for event X", since the plugin completely removes event-listeners from the core library. You will no longer have to createnoopevent-listeners on events you're not using simply to suppress these warnings.
- [Changed] Improve iOS/Android acquisition of
motionchangelocation to ensure a recent location is fetched. - [Changed] Implement
#getSensorsmethod for both iOS & Android. Returns an object indicating the presense of accelerometer, gyroscope and magnetometer. If any of these sensors are missing, the motion-detection system for that device will poor. - [Changed] The
activitychangesuccess callback method signature has been changed from{String} activityName->{Object}containing bothactivityNameas well asconfidence. This event only used to fire after theactivityNamechanged (eg:on_foot->in_vehicle), regardless ofconfidence. This event will now fire for any change in activity, includingconfidencechanges. - [Changed] iOS
emailLogwill gzip the attached log file. - [Added] Implement new Android config
notificationPriorityfor controlling the behaviour of theforegroundServicenotification and notification-bar icon. - [Changed] Tweak iOS Location Authorization to not show locationAuthorizationAlert if user initially denies location permission.
- [Fixed] Android: Remove isMoving condition from geofence proximity evaluator.
- [Fixed] Android was creating a foreground notification even when
foregroundService: false - [Fixed] iOS 11 fix: Added new location-authorization string
NSLocationAlwaysAndWhenInUseUsageDescription. iOS 11 now requires location-authorization popup to allow user to select eitherAlwaysorWhenInUse.
- [Fixed] Android & iOS will ensure old location samples are ignored with
getCurrentPosition - [Fixed] Android
providerchangeevent would continue to persist a providerchange location even when plugin was disabled for the case where location-services is disabled by user. - [Fixed] Don't mutate iOS
urlto lowercase. Just lowercase the comparison when checking for301redirects. - [Changed] Android will attempt up to 5
motionchangesamples instead of 3. Cheaper devices can take longer to lock onto GPS. - [Changed] Android foregroundService notification priority set to
PRIORITY_MINso that notification doesn't always appear on top. - [Fixed] Android plugin was not nullifying the odometer reference location when
#stopmethod is executed, resulting in erroneous odometer calculations if plugin was stopped, moved some distance then started again. - [Added] Android plugin will detect presense of Sensors
ACCELEROMETER,GYROSCOPE,MAGNETOMETERandSIGNIFICANT_MOTION. If any of these sensors are missing, the AndroidActivityRecognitionAPIis considered non-optimal and plugin will add extra intelligence to assist determining when device is moving. - [Fixed] Bug in broadcast event
GEOFENCEnot being fired whenMainActivityis terminated (only applies to those useHeadlessJS). - [Added] Implement Javascript API for
removeAllListenersfor...you guessed it: removing all event-listeners. - [Fixed] Android scheduler issue when device is rebooted and plugin is currently within a scheduled ON period (fails to start)
- [Fixed] (Android) Fix error calling
stopWatchPositionbefore#configurecallback has executed. Also add support for executing#getCurrentPositionbefore#configurecallback has fired. - [Added] (Android) Listen to LocationResult while stopTimeout is engaged and perform manual motion-detection by checking if location distance from stoppedAtLocation is > stationaryRadius
- [Fixed] Bug in literal schedule parsing for both iOS and Android
- [Fixed] Bug in Android scheduler after app terminated. Configured schedules were not having their
onTimeandoffTimezeroed, resulting in incorrect time comparison.
- [Fixed] Bug in Android scheduler after app terminated. Configured schedules were not having their
SECONDandMILLISECONDzeroed resulting in incorrect time comparison.
- [Added] New config
stopOnStationaryfor both iOS and Android. Allows you to automatically#stoptracking when thestopTimeouttimer elapses. - [Added] Support for configuring the "Large Icon" (
notificationLargeIcon) on AndroidforegroundServicenotification.notificationIconhas now been aliased ->notificationSmallIcon. - [Fixed] iOS timing issue when fetching
motionchangeposition after initial#start-- since the significant-location-changes API (SLC) is engaged in the#stopmethod and eagerly returns a location ASAP, that first SLC location could sometimes be several minutes old and come from cell-tower triangulation (ie: ~1000m accuracy). The plugin could mistakenly capture this location as themotionchangelocation instead of waiting for the highest possible accuracy location that was requested. SLC API will be engaged only after themotionchangelocation has been received. - [Fixed] Headless JS
RNBackgroundGeolocationEventReceiverwas broken inreact-native 0.45.0-- they removed a mechanism for fetching theReactApplication. Changed to using a much simpler, backwards-compatible mechansim using simplecontext.getApplicationContext(). - [Fixed] On Android, when adding a massive number of geofences (ie: thousands), it can take several minutes to perform all
INSERTqueries. There was a threading issue which could cause the main-thread to be blocked while waiting for the database lock from the geofence queries to be released, resulting in an ANR (app isn't responding) warning. - [Changed] Changing the Android foreground-service notification is now supported (you no longer need to
#stop/#startthe plugin for changes to take effect). - [Added] New config option
httpTimeout(milliseconds) for configuring the timeout where the plugin will give up on sending an HTTP request. - [Added] Improved
react-native linkautomation for iOS. XCode setup is now completely handled! - [Fixed] Android bug in
RNBackgroundGeolocationEventReceiver. Catch errors whenReactNativeApplicationcan not be referenced (this can happen duringstartOnBootwhen the react native App has not yet booted, thus noregisterHeadlessTaskhas been executed yet. It can also occur if the plugin has not been configured withforegroundService: true-- Headless JS requiresforegroundService: true) - [Fixed] When iOS engages the
stopTimeouttimer, the OS will pause background-execution if there's no work being performed, in spite ofstartBackgroundTask, preventing thestopTimeouttimer from running. iOS will now keep location updates running at minimum accuracy duringstopTimeoutto prevent this. - [Fixed] Ensure iOS background "location" capability is enabled before asking
CLLocationManagertosetBackgroundLocationEnabled. - [Added] Implement ability to provide literal dates to schedule (eg:
2017-06-01 09:00-17:00) - [Added] When Android motion-activity handler detects
stopTimeouthas expired, it will initiate amotionchangewithout waiting for thestopTimeouttimer to expire (there were cases where thestopTimeouttimer could be delayed from firing due likely to vendor-based battery-saving software)
- [Fixed] iOS has a new hook to execute an HTTP flush when network reachability is detected. However, it was not checking if
autoSync: trueor state ofautoSyncThreshold.
- [Added] When iOS detects a network connection with
autoSync: true, an HTTP flush will be initiated. - [Fixed] Improve switching between tracking-mode location and geofence. It's not necessary to call
#stopbefore executing#start/#startGeofences. - Fixed] iOS
maximumAgewithgetCurrentPositionwasn't clearing the callbacks when current-location-age was<= maximumAge - [Fixed] iOS when
#stopis executed, nullify the odometer reference location. - [Fixed] iOS issue with
preventSuspend: true: When amotionchangeevent withis_moving: falseoccurred, the event was incorrectly set toheartbeatinstead ofmotionchange. - [Fixed] Android null pointer exception when using
startOnBoot: true, forceReloadOnBoot: true: there was a case where last known location failed to return a location. The lib will check for null location in this case. - [Changed] iOS minimum version is now
8.4. Plugin will log an error when used on versions of iOS that don't implement the methodCLLocationManager#requestLocation - [Fixed] iOS bug executing
#setConfigmultiple times too quickly can crash the plugin when multiple threads attempt to modify anNSMutableDictionary - [Fixed] Android was rounding
battery_levelto 1 decimal place. - [Fixed] iOS geofences-only mode was not using significant-location-change events to evaluate geofences within proximity.
- [Changed] iOS now uses
CLLocationManager requestLocationto request themotionchangeposition, rather than counting samples. This is a more robust way to get a single location - [Fixed] iOS crash when providing
nullvalues inObjectconfig options (ie:#extras,#params,#headers, etc) - [Fixed] iOS was creating
backgroundTaskinlocationlistener even if no listeners were registered, resulting in growing list of background-tasks which would eventually beFORCE KILLED. - [Added] New config option
locationsOrderDirection [ASC|DESC]for controlling the order that locations are selected from the database (and synced to your server). Defaults toASC. - [Added] Support for React Native "Headless JS"
- [Added] Support for iOS geofence
DWELLtransitions.
- [Fixed] iOS bug when composing geofence data for peristence. Sometimes it appended a
location.geofence.locationdue to a sharedNSDictionary - [Changed] The licensing model of Android now enforces license only for release builds. If an invalid license is configured while runningin debug mode, a Toast warning will appear "BackgroundGeolocation is running in evaluation mode.", but the plugin will work.
- [Fixed] iOS bug with HTTP
401handling. - [Fixed] Forgot to post updated (backwards-compatible) version of
#getCurrentPositionmethod, re-arranging the order of params according to docs:#getCurrentPosition(successFn, failureFn, config)
- [Changed] Refactor Settings Management.
- [Fixed]
geofenceevent not passing Geofence#extras. - [Fixed] iOS geofence identifiers containing ":" character were split and only the last chunk returned. The plugin itself prefixes all geofences it creates with the string
TSGeofenceManager:and the string-splitter was too naive. Uses aRegExpreplace to clear the plugin's internal prefix. - [Changed] Refactored API Documentation
- [Added] HTTP JSON template features. See HTTP Features. You can now template your entire JSON request data sent to the server by the plugin's HTTP layer.
- [Fixed] Incorrect
peerDependenciesspecifiedreact-native >= 0.40.0
- [Changed] Module now works for all versions of react-native, both pre and post
0.40.0.
- [Fixed] Fix issue with Location Authorization alert popup up when not desired.
- [Fixed] Support for
react-native-0.40.0
- [Added] Ability to provide optional arbitrary meta-data
extrason geofences. - [Changed] Location parameters
heading,accuracy,odometer,speed,altitude,altitudeAccuracyare now fixed at 2 decimal places. - [Changed] When adding a geofence (either
#addGeofenceor#addGeofences), if a geofence already exists with the providedidentifier, the plugin will first destroy the existing one before creating the new one.what was configured. - [Fixed] Improve odometer accuracy. Introduce
desiredOdometerAccuracyfor setting a threshold of location accuracy for calculating odometer. Any location havingaccuracy > desiredOdometerAccuracywill not be used for odometer calculation. - [Fixed] When configured with a schedule, the Schedule parser wasn't ordering the schedule entries by start-time. Since the scheduler seeks the first matching schedule-entry, it could fail to pick the latest entry.
- [Changed] Add ability to set odometer to any arbitrary value. Before, odometer could only be reset to
0viaresetOdometer. The plugin now usessetOdometer(Float, successFn, failureFn.resetOdometeris now just an alias forsetOdometer(0).setOdometerwill now internally perform a#getCurrentPosition, so it can know the exact location where the odometer was set at. As a result, using#setOdometeris exactly like performing a#getCurrentPositionand thesuccess/failurecallbacks use the same method-signature, where thesuccesscallback is provided thelocation
- [Fixed] Logic bug in
TSGeofenceManager; was not performing geospatial query when changing state from MOVING -> STATIONARY. - [Added] Geofences-only mode for both iOS and Android BETA. Start geofences-only mode with method
#startGeofences. - [Changed] Add some intelligence to iOS motion-detection system: Use a Timer of
activityRecognitionIntervalseconds before engaging location-services after motion is detected. This helps to reduce false-positives, particularly when usingpreventSuspendwhile walking around one's house or office. - [Changed] Add more intelligence to iOS motion-detection system: The plugin will be eager to engage the stop-detection, as soon as it detects
still, regardless of confidence. When the plugin is currently in the moving state and detectsstill, it will engage a timer ofactivityRecognitionIntervalmilliseconds -- when this timer expires and the motion-detector still reportsstill, the stop-detection system will be engaged. If any moving type activity occurs during this time, the timer will be cancelled. - [Changed] With
preventSuspend: true, the plugin will no longer immediately engage location-services as soon as it sees a "moving"-type motion-activity: it will now calculate if the current position is beyond stationary geofence. This helps reduce false-positives engaging location-services while simply walking around one's home or office. - [Fixed] iOS
batchSync: When only 1 record in batch, iOS fails to pack the records in a JSONlocation: [], appending to alocation: {}instead.
- [Changed] The plugin will ignore
autoSyncThresholdwhen amotionchangeevent occurs. - [Fixed] Fixed ui-blocking issue when plugin boots with locations in its database with
autoSync: true. Found a case where the plugin was executing HTTP Service on the UI thread. - [Fixed] iOS Scheduler puked when provided with a
nullor[]schedule. - [Changed] iOS Scheduler behaviour changed to match Android, where
#stopScheduledoes not execute#stopon the plugin itself.
- [Fixed]
getGeofencesissue #158.getGeofenceswasn't migrated to accept the new data-format provided byTSLocationManager, which now returns anNSArrayofNSDictionary-- notCLCircularRegion. - [Changed] Remove
CocoaLumberjackstatic lib fromTSLocationManager. Compiling it intoTSLocationManagercauses conflicts with others also using this popular logging framework. - [Fixed] Bug exposed with
batchSync. The plugin was failing to destroy records after successful HTTP request due to bug in FMDB binding array params forDELETE FROM location WHERE id IN(?).
- [Added] Implement a mechanism for removing listeners
removeListener(@aliasun). This is particularly important for Android when usingstopOnTerminate: false. Listeners onBackgroundGeolocationshould be removed incomponentDidUnmount:
componentDidMount() {
BackgroundGeolocation.on('location', this.onLocation);
}
onLocation(location) {
console.log('- Location: ', location);
}
componentDidUnmount() {
BackgroundGeolocation.un('location', this.onLocation);
}- [Fixed] iOS issue when multiple geofences trigger simultaneously, where only the last one was fired to the client and persisted.
- [Added] Implemented ability for iOS to trigger a geofence
ENTERevent immediately when device is already inside the geofence (Android has always done this). This behaviour can be controlled with the new config@param {Boolean} geofenceInitialTriggerEntry [true]. This behaviour defaults totrue.
- [Fixed] Bug in
stopDetectionDelaylogic - [Fixed] Geofencing transistion event logging wouldn't occur when configured for
debug: false
- [Changed] Refactor iOS Logging system to use popular CocoaLumberjack library. iOS logs are now stored in the database! By default, logs are stored for 3 days, but is configurable with
logMaxDays. Logs can now be filtered by logLevel:
| logLevel | Label |
|---|---|
0 |
LOG_LEVEL_OFF |
1 |
LOG_LEVEL_ERROR |
2 |
LOG_LEVEL_WARNING |
3 |
LOG_LEVEL_INFO |
4 |
LOG_LEVEL_DEBUG |
5 |
LOG_LEVEL_VERBOSE |
fetch logs with #getLog or #emailLog methods. Destroy logs with #destroyLog.
-
[Fixed]
#emailLognow finally works. -
[Fixed] If user declines "Motion Activity" permission, plugin failed to detect this authorization failure and fallback to the accelerometer-based motion-detection system.
-
[Changed] Refactored Geolocation system. The plugin is no longer bound by native platform limits on number of geofences which can be monitored (iOS: 20; Android: 100). You may now monitor infinite geofences. The plugin now stores geofences in its SQLite db and performs a geospatial query, activating only those geofences in proximity of the device (@config #geofenceProximityRadius, @event
geofenceschange). See the new Geofencing Guide
- [Fixed] Bug in preventSuspend during background-fetch event where plugin was left in preventSuspend mode after being rebooted in background.
- [Fixed] Bug in preventSuspend during background-fetch event where plugin was left in preventSuspend mode when not configured to do so.
- [Fixed] Bug in prevent-suspend where the plugin failed to re-start its prevent-suspend timer if no MotionActivity event occurred during that interval. Prevent-suspend system should now operate completely independently of MotionDetector.
- [Fixed]
#stopmethod wasn't callingstopMonitoringSignificantChanges, resulting in location-services icon failing to toggle OFF. Fixes issue #908
- [Fixed]
#removeGeofenceswas removing the stationary-geofence. This would prevent stationary-exit if executed while plugin is in stationary-mode. - [Fixed] Accept callbacks to
#stopmethod. Fixes #122 - [Added] Add new config
@param {Integer} autoSyncThreshold [0]. Allows you to specify a minimum number of persisted records to trigger an auto-sync action. - [Fixed] Crash when url configured to
null. Issue #119 - [Fixed] Missing Javascript API method
beginBackgroundTask. Issue #109 - [Added] iOS
watchPositionmechanism. - [Changed] Refactored iOS motion-detection system. Improved iOS motion-triggering when using
CMMotionActivityManager(ie: when not usingdisableMotionActivityUpdates: true). iOS can now trigger out of stationary-mode just like android, where it sees a 'moving-type' motion-activity (eg: 'on_foot', 'in_vehicle', etc). Note: this will still occur only when your app isn't suspended (eg: app is in foreground,preventSuspend: true, or#watchPositionis engaged). - [Changed] Refactored iOS "prevent suspend" system to be more robust.
- [Fixed] iOS locations sent to Javascript client had a different
uuidthan the one persisted to database (and synced to server).
- [Fixed] Incorrect param signature send to
motionchangeevent. Was sending just location-object. Should have been{location: Object, isMoving: Boolean} - [Added] Stub
#stopWatchPositionmethod until it's implemented - [Fixed] Documentation bugs with
addGeofence,removeGeofence
- [Fixed] Scheduler parsing bug.
- [Added] Add new dependency react-native-background-fetch for improved handling of background-geolocation while app is suspended.
react-native-background-fetchis managed by Transistor Software. This iOS-only API awakens a suspended iOS app about every 15 min, providing exactly 30s of background running time. background-geolocation uses these events to sync stored locations, check schedule, samples accelerometer for movement (improves motionchange triggering), and determines whether app should havestopOnTerminate
- [Changed] Implement improved location-authorization code with automatic native alert popup directing user to settings to fix the problem. Added new config param
locationAuthorizationAlertallowing you to configure the strings on the Alert - [Fixed] iOS setting http
methodnot being respected (was always doingPOST).
- [Added] #providerchange method. Fires when user toggles location-services.
- [Changed] Use
TSLocationManageras a singleton. This may help with issues during development where you reload Javascript, causing multiple instances ofTSLocationManagerto begin recording locations. - [Changed]
#setConfigacceptssuccessandfailurecallbacks
- [Changed]
Schedulerwill useLocale.USin its Calendar operations, such that the days-of-week correspond to Sunday=1..Saturday=7. - [Fixed] iOS Added
event [motionchange|geofence]to location-data returned toonLocationevent. - [Changed] Refactor odometer calculation for both iOS and Android. No longer filters out locations based upon average location accuracy of previous 10 locations; instead, it will only use the current location for odometer calculation if it has accuracy < 100.
- [Fixed] Missing iOS setting
locationAuthorizationRequestafter Settings service refactor - [Added] new
#getCurrentPositionoptions#samplesand#desiredAccuracy.#samplesallows you to configure how many location samples to fetch before settling sending the most accurate to yourcallbackFn.#desiredAccuracywill keep sampling until an location having accuracy<= desiredAccuracyis achieved (or#timeoutelapses). - [Added] new
#eventtypeheartbeatadded tolocationparams (#is_heartbeatis @deprecated). - [Fixed] When enabling iOS battery-state monitoring, use setter method
setBatteryMonitoringEnabledrather than setting property. This seems to have changed with latest iOS
- [Changed] Refactor iOS motion-detection system. When not set to
disableMotionActivityUpdates(default), the plugin will not activate the accelerometer and will rely instead purely upon updates from the M7 chip. WhendisableMotionActivityUpdatesis set tofalse, the pure acceleromoeter based activity-detection has been improved to give more accurate results of the detected activity (ie:on_foot, walking, stationary)
- [Fixed] Bugs in iOS option
useSignificantChangesOnly - [Changed] Refactor HTTP Layer to stop spamming server when it returns an error (used to keep iterating through the entire queue). It will now stop syncing as soon as server returns an error (good for throttling servers).
- [Added] Migrate iOS settings-management to new Settings service
- [Fixed] bugs in Scheduler
- [Changed] Forward declare
sqlite.h(#76) - [Added] Improved functionality with
stopOnTerminate: false. Ensure a stationary-geofence is created when plugin is closed while in moving state; this seems to improve the time it takes to trigger the iOS app awake after terminate. When plugin is rebooted in background due to geofence-exit, the plugin will briefly sample the accelerometer to see if device is currently moving.
- [Added] Add schedule to
#getState
- [Added] Introduce new Scheduling feature
- [Changed] ios halt stop-detection distance was using
distanceFilter; changed to usestationaryRadius. This effects users using the accelerometer-based stop-detection system: after stop is detected, the device must movestationaryRadiusmeters away from location where stop was detected. - [Changed] When
maxRecordsToPersist == 0, don't persist any record. - [Added] Implement
startOnBootparam for iOS. iOS always ignoredstartOnBoot. If you setstartOnBoot: falsenow, iOS will not begin tracking when launched in background after device is rebooted (eg: from a background-fetch event, geofence exit or significant-change event) - [Fixed] Missing
heartbeatevent.
- [Fixed] ios
stopOnTerminatewas defaulting tofalse. Docs say default istrue. - [Fixed] ios
useSignificantChangesOnlywas broken. - [Added] Add odometer to ios location JSON schema
- [Added] Log network reachability flags on connection-type changes.
- [Added]
maxRecordsToPersistto limit the max number of records persisted in plugin's SQLite database. - [Added] API methods
#addGeofences(for adding a list-of-geofences),#removeGeofences - [Changed] The plugin will no longer delete geofences when
#stopis called; it will merely stop monitoring them. When the plugin is#started again, it will start monitoring any geofences it holds in memory. To completely delete geofences, use new method#removeGeofences. - [Fixed] iOS battery
is_chargingwas rendering as1/0instead of booleantrue/false
- [Fixed] Issue with timers not running on main-thread.
- [Fixed] Issue with acquriring stationary-location on a stale location.
- [Fixed] Removed some log messages appearing when
{debug: false}
- [Fixed] getState method
- [Changed] Standardize the Javascript API methods to send both a
successas well asfailurecallbacks. - [Changed] iOS
emailLogmethod will attach the log-file as an email attachment rather than rendering the log to the email body. Email body contains the result ofgetStatenow. This standardizes the behaviour between iOS and Android. - [Added] CHANGELOG
- [Added]
@param {Boolean} pausesLocationUpdatesAutomatically [undefined]. This option allows you to completely disable the stop-detection system by setting this tofalse. Location-services will never turn off once engaged. When set totrue, you will engage the iOS default of automatically shutting off location-updates after exactly 15min. When you don't provide a value, the plugin's accelerometer-based stop-detection system will be used, where #stopTimeout will be used to determine when to shut off location-services. This parameter is essentially a tri-state:true,false,undefined. - [Added]
@param {String} locationAuthorizationRequest [Always]This allows you choose which location-authorization to ask user for:WhenInUseorAlways(default). Some developers wish to display the blue top-bar when the app goes to background to show the user their location is being tracked (eg: fitness apps) - [Changed] Refactored logging.
- [Fixed] Bug-fixes and improvements to prevent-suspend mode.
- [Fixed] Refactored iOS persistence layer; better multi-threading support.
- [Fixed]
getCurrentPositiontimeout. - [Changed]
preventSuspend,heartbeatIntervalto be changed viasetConfig. - [Changed]
TSReachabilityconstantkReachabilityChangedNotificationtotsReachabilityChangedNotificationto prevent conflicts with other libs. - [Fixed] Location-error handling during prevent-suspend mode.
- [Added] Add methods
#getCountand#insertLocation(for manually adding locations to plugin's SQLite db) - [Added] Document
#maxBatchSizeconfig (limits number of records per HTTP request when usingbatchSync: true - [Fixed] Fixed bug in
maxDaysToPerist - [Added] Implemented new
#getLog,#emailLogmethods for fetching the current application log at runtime.










