- [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.