transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.63k stars 425 forks source link

Geofencing EXIT event firing only upon re-entry [iOS] #1096

Closed FrikkieSnyman closed 4 years ago

FrikkieSnyman commented 4 years ago

Your Environment

Expected Behavior

I expect to receive an event when I EXIT the Geofence.

Actual Behavior

The radius is set to 200m. I do receive the initial ENTRY event, followed by a DWELL shortly after. Upon leaving the area I do not receive any events. Then, upon re-entering, it seems that the ENTRY, EXIT and DWELL events all trigger within 30ms of each other:

From the logs:

2020-07-06 11:53:47.721
╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceManager fireGeofenceEvent:] 📢ENTER Geofence: HOME200
╚═══════════════════════════════════════════════════════════
2020-07-06 11:53:58.835
╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceManager fireGeofenceEvent:] 📢DWELL Geofence: HOME200
╚═══════════════════════════════════════════════════════════

.
.
.

2020-07-06 12:06:46.072
╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceManager fireGeofenceEvent:] 📢EXIT Geofence: HOME200
╚═══════════════════════════════════════════════════════════

2020-07-06 12:06:46.072
╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceManager fireGeofenceEvent:] 📢ENTER Geofence: HOME200
╚═══════════════════════════════════════════════════════════
2020-07-06 12:06:46.075
╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceManager fireGeofenceEvent:] 📢EXIT Geofence: HOME200
╚═══════════════════════════════════════════════════════════

2020-07-06 12:06:46.096
╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceManager fireGeofenceEvent:] 📢DWELL Geofence: HOME200
╚═══════════════════════════════════════════════════════════

I tested it this morning by setting a geofence at my current location, then going out for a ride on my bike, about 1km away from the original point.

Steps to Reproduce

  1. Use code above
  2. Move more than 200m away from current location
  3. Do not receive EXIT event
  4. Receive ENTRY, EXIT, and DWELL upon re-entry of area.

Context

I'm trying to send a push notification when a user leaves a certain area.

Debug logs

Logs ``` 2020-07-06 11:51:44.804 ℹ️-[TSDBLogger db_delete] maxAge: 259200 2020-07-06 11:51:44.806 ℹ️-[TSLocationManager init] ╔═════════════════════════════════════════════ ║ TSLocationManager (build 359) ╠══════════════════════════════════════════════ { activityRecognitionInterval = 10000; activityType = 1; authorization = { }; autoSync = 1; autoSyncThreshold = 0; batchSync = 0; debug = 0; desiredAccuracy = "-1"; desiredOdometerAccuracy = 100; didLaunchInBackground = 0; disableAutoSyncOnCellular = 0; disableElasticity = 0; disableLocationAuthorizationAlert = 0; disableMotionActivityUpdates = 0; disableStopDetection = 0; distanceFilter = 1; elasticityMultiplier = 1; enableTimestampMeta = 0; enabled = 1; encrypt = 0; extras = { }; geofenceInitialTriggerEntry = 1; geofenceProximityRadius = 2000; geofenceTemplate = ""; headers = { }; heartbeatInterval = 60; httpRootProperty = location; httpTimeout = 60000; iOSHasWarnedLocationServicesOff = 0; isFirstBoot = 0; isMoving = 0; lastLocationAuthorizationStatus = 3; locationAuthorizationAlert = { cancelButton = Cancel; instructions = "To use background location, you must enable '{locationAuthorizationRequest}' in the Location Services settings"; settingsButton = Settings; titleWhenNotEnabled = "Background location is not enabled"; titleWhenOff = "Location services are off"; }; locationAuthorizationRequest = Always; locationTemplate = ""; locationTimeout = 60; locationsOrderDirection = ASC; logLevel = 5; logMaxDays = 3; maxBatchSize = "-1"; maxDaysToPersist = 1; maxRecordsToPersist = "-1"; method = POST; minimumActivityRecognitionConfidence = 70; odometer = 0; params = { }; pausesLocationUpdatesAutomatically = 1; persistMode = 0; preventSuspend = 0; schedule = ( ); schedulerEnabled = 0; showsBackgroundLocationIndicator = 0; startOnBoot = 1; stationaryRadius = 25; stopAfterElapsedMinutes = "-1"; stopDetectionDelay = 0; stopOnStationary = 0; stopOnTerminate = 0; stopTimeout = 5; trackingMode = 0; url = ""; useSignificantChangesOnly = 0; } 2020-07-06 11:51:44.812 ℹ️-[GeofenceDAO init] CREATE TABLE IF NOT EXISTS geofences (id INTEGER PRIMARY KEY AUTOINCREMENT, identifier TEXT NOT NULL UNIQUE, latitude DOUBLE NOT NULL, sin_latitude DOUBLE NOT NULL, cos_latitude DOUBLE NOT NULL, longitude DOUBLE NOT NULL, sin_longitude DOUBLE NOT NULL, cos_longitude DOUBLE NOT NULL, radius DOUBLE NOT NULL, notifyOnEntry BOOLEAN NOT NULL DEFAULT 0, notifyOnExit BOOLEAN NOT NULL DEFAULT 0, notifyOnDwell BOOLEAN NOT NULL DEFAULT 0, loiteringDelay DOUBLE NOT NULL DEFAULT 0, extras TEXT) 2020-07-06 11:51:44.812 ℹ️-[GeofenceDAO init] CREATE index IF NOT EXISTS identifier ON geofences (identifier);CREATE index IF NOT EXISTS latitude ON geofences (latitude);CREATE index IF NOT EXISTS longitude ON geofences (longitude);CREATE index IF NOT EXISTS sin_latitude ON geofences (sin_latitude);CREATE index IF NOT EXISTS cos_latitude ON geofences (cos_latitude);CREATE index IF NOT EXISTS sin_longitude ON geofences (sin_longitude);CREATE index IF NOT EXISTS cos_longitude ON geofences (cos_longitude); 2020-07-06 11:51:44.833 🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 3 2020-07-06 11:51:44.840 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2020-07-06 11:51:44.841 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2020-07-06 11:51:44.841 🔵-[BackgroundTaskManager locationManager:didChangeAuthorizationStatus:] 3 2020-07-06 11:51:44.841 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2020-07-06 11:51:44.874 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2020-07-06 11:53:27.346 ℹ️-[TSDBLogger db_delete] maxAge: 259200 2020-07-06 11:53:27.348 ℹ️-[TSLocationManager init] ╔═════════════════════════════════════════════ ║ TSLocationManager (build 359) ╠════════════════════════════════════════════════════════════════════════ ║ TSLocationManager (build 359) ╠═══════════════════════════\342═══════════════════ { activityRecognitionInterval = 10000; activityType = 1; authorization = { }; autoSync = 1; autoSyncThreshold = 0; batchSync = 0; debug = 0; desiredAccuracy = "-1"; desiredOdometerAccuracy = 100; didLaunchInBackground = 0; disableAutoSyncOnCellular = 0; disableElasticity = 0; disableLocationAuthorizationAlert = 0; disableMotionActivityUpdates = 0; disableStopDetection = 0; distanceFilter = 1; elasticityMultiplier = 1; enableTimestampMeta = 0; enabled = 1; encrypt = 0; extras = { }; geofenceInitialTriggerEntry = 1; geofenceProximityRadius = 2000; geofenceTemplate = ""; headers = { }; heartbeatInterval = 60; httpRootProperty = location; httpTimeout = 60000; iOSHasWarnedLocationServicesOff = 0; isFirstBoot = 0; isMoving = 0; lastLocationAuthorizationStatus = 3; locationAuthorizationAlert = { cancelButton = Cancel; instructions = "To use background location, you must enable '{locationAuthorizationRequest}' in the Location Services settings"; settingsButton = Settings; titleWhenNotEnabled = "Background location is not enabled"; titleWhenOff = "Location services are off"; }; locationAuthorizationRequest = Always; locationTemplate = ""; locationTimeout = 60; locationsOrderDirection = ASC; logLevel = 5; logMaxDays = 3; maxBatchSize = "-1"; maxDaysToPersist = 1; maxRecordsToPersist = "-1"; method = POST; minimumActivityRecognitionConfidence = 70; odometer = 0; params = { }; pausesLocationUpdatesAutomatically = 1; persistMode = 0; preventSuspend = 0; schedule = ( ); schedulerEnabled = 0; showsBackgroundLocationIndicator = 0; startOnBoot = 1; stationaryRadius = 25; stopAfterElapsedMinutes = "-1"; stopDetectionDelay = 0; stopOnStationary = 0; stopOnTerminate = 0; stopTimeout = 5; trackingMode = 0; url = ""; useSignificantChangesOnly = 0; } 2020-07-06 11:53:27.350 ℹ️-[GeofenceDAO init] CREATE TABLE IF NOT EXISTS geofences (id INTEGER PRIMARY KEY AUTOINCREMENT, identifier TEXT NOT NULL UNIQUE, latitude DOUBLE NOT NULL, sin_latitude DOUBLE NOT NULL, cos_latitude DOUBLE NOT NULL, longitude DOUBLE NOT NULL, sin_longitude DOUBLE NOT NULL, cos_longitude DOUBLE NOT NULL, radius DOUBLE NOT NULL, notifyOnEntry BOOLEAN NOT NULL DEFAULT 0, notifyOnExit BOOLEAN NOT NULL DEFAULT 0, notifyOnDwell BOOLEAN NOT NULL DEFAULT 0, loiteringDelay DOUBLE NOT NULL DEFAULT 0, extras TEXT) 2020-07-06 11:53:27.350 ℹ️-[GeofenceDAO init] CREATE index IF NOT EXISTS identifier ON geofences (identifier);CREATE index IF NOT EXISTS latitude ON geofences (latitude);CREATE index IF NOT EXISTS longitude ON geofences (longitude);CREATE index IF NOT EXISTS sin_latitude ON geofences (sin_latitude);CREATE index IF NOT EXISTS cos_latitude ON geofences (cos_latitude);CREATE index IF NOT EXISTS sin_longitude ON geofences (sin_longitude);CREATE index IF NOT EXISTS cos_longitude ON geofences (cos_longitude); 2020-07-06 11:53:27.369 🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 3 2020-07-06 11:53:27.381 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2020-07-06 11:53:27.381 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2020-07-06 11:53:27.381 🔵-[BackgroundTaskManager locationManager:didChangeAuthorizationStatus:] 3 2020-07-06 11:53:27.389 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2020-07-06 11:53:27.390 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2020-07-06 11:53:36.962 ℹ️-[GeofenceDAO destroyAll]_block_invoke 2020-07-06 11:53:36.965 ╔═══════════════════════════════════════════════════════════ ║ -[TSLocationManager stop] ╚═════════════════════════════════════════════════════════════════════════ ║ -[TSLocationManager stop] ╚══════════════════════════════════════════════════════\342═════ 2020-07-06 11:53:36.965 ℹ️-[TSConfig persist] 2020-07-06 11:53:36.969 ℹ️-[TSLocationManager clearLastOdometerLocation] 2020-07-06 11:53:36.969 🔴-[TSGeofenceManager stop] 2020-07-06 11:53:36.970 🔴-[TSGeofenceManager stopMonitoringGeofences] 2020-07-06 11:53:36.972 🔴-[TSGeofenceManager stopMonitoringGeofences] HOME200 2020-07-06 11:53:36.973 🔴-[TSGeofenceManager stopMonitoringGeofences] HOME50 2020-07-06 11:53:36.973 🔴-[TSGeofenceManager stopMonitoringGeofences] HOME100 2020-07-06 11:53:36.974 🔴-[TSLocationManager stopUpdatingLocation] 2020-07-06 11:53:36.977 🔴-[TSLocationManager stopMonitoringBackgroundFetch] BackgroundFetch: OFF 2020-07-06 11:53:36.979 🔴-[TSLocationManager stopMonitoringSignificantLocationChanges] 2020-07-06 11:53:36.985 🔵-[TSLocationManager getCurrentPosition:] 2020-07-06 11:53:36.986 🎾-[LocationManager startUpdatingLocation] ON 2020-07-06 11:53:36.991 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2020-07-06 11:53:36.992 📍<+[redacted],+[redacted]> +/- 65.00m (speed -1.00 mps / course -1.00) @ 06/07/2020, 11:53:28 Central European Summer Time 2020-07-06 11:53:36.992 ╔═══════════════════════════════════════════════════════════ ║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 3 ╚═══════════════════════════════════════════════════════════ ║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 3 ╚══════════════════\342═════════════════════════════════════════ 2020-07-06 11:53:37.002 📍<+[redacted],+[redacted]> +/- 65.00m (speed -1.00 mps / course -1.00) @ 06/07/2020, 11:53:36 Central European Summer Time 2020-07-06 11:53:37.002 ╔═══════════════════════════════════════════════════════════ ║ -[LocationManager locationManager:didUpdateLocations:] Sample 2 of 3 ╚═══════════════════════════════════════════════════════════ 2020-07-06 11:53:37.164 📍<+[redacted],+[redacted]> +/- 122.64m (speed -1.00 mps / course -1.00) @ 06/07/2020, 11:53:37 Central European Summer Time 2020-07-06 11:53:37.164 🔴-[LocationManager stopUpdatingLocation] OFF 2020-07-06 11:53:37.164 ╔═══════════════════════════════════════════════════════════ ║ -[LocationManager locationManager:didUpdateLocations:] Sample 3 of 3 ╚═══════════════════════════════════════════════════════════ 2020-07-06 11:53:37.176 ℹ️-[GeofenceDAO doInsert:geofence:] HOME200 2020-07-06 11:53:37.182 ℹ️-[TSGeofenceManager onGeofence:] 2020-07-06 11:53:37.202 ℹ️-[TSConfig persist] 2020-07-06 11:53:37.204 🔵-[TSLocationManager ready] 2020-07-06 11:53:37.207 ╔═══════════════════════════════════════════════════════════ ║ -[TSLocationManager startGeofences] ╚══════════════════════════════════════════════════════════════════════ ║ -[TSLocationManager startGeofences] ╚═══════════════════════════════\342════════════════════════════ 2020-07-06 11:53:37.207 ℹ️-[TSLocationManager doStart:] trackingMode: 0 2020-07-06 11:53:37.207 ℹ️-[TSConfig persist] 2020-07-06 11:53:37.208 ℹ️-[TSLocationManager clearLastOdometerLocation] 2020-07-06 11:53:37.208 🎾-[TSGeofenceManager start] 2020-07-06 11:53:37.209 🔵-[TSLocationManager setPace:] 0 2020-07-06 11:53:37.210 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 2020-07-06 11:53:37.211 ╔═══════════════════════════════════════════════════════════ ║ -[TSHttpService flush:] ╚═══════════════════════════════════════════════════════════ 2020-07-06 11:53:37.211 ╔═══════════════════════════════════════════════════════════ ║ -[TSHttpService finish:error:] Success: 0 ╚═══════════════════════════════════════════════════════════ 2020-07-06 11:53:37.212 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2020-07-06 11:53:37.213 🎾-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON 2020-07-06 11:53:37.241 ℹ️-[TSLocationManager startMonitoringBackgroundFetch]_block_invoke Configured BackgroundFetch 2020-07-06 11:53:37.242 📍<+[redacted],+[redacted]> +/- 1097.66m (speed -1.00 mps / course -1.00) @ 28/06/2020, 15:05:21 Central European Summer Time 2020-07-06 11:53:37.242 ╔═══════════════════════════════════════════════════════════ ║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 679696.0s ╚═══════════════════════════════════════════════════════════ 2020-07-06 11:53:37.242 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Received stale motionchange location. Retrying... 2020-07-06 11:53:37.242 📍<+[redacted],+[redacted]> +/- 65.00m (speed -1.00 mps / course -1.00) @ 06/07/2020, 11:53:36 Central European Summer Time 2020-07-06 11:53:37.242 ╔═══════════════════════════════════════════════════════════ ║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 0.3s ╚═══════════════════════════════════════════════ ║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 0.3s ╚════════════════════════════════\342═══════════════════════════ 2020-07-06 11:53:37.242 ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+[redacted],+[redacted]> +/- 65.00m (speed -1.00 mps / course -1.00) @ 06/07/2020, 11:53:36 Central European Summer Time 2020-07-06 11:53:37.242 🔵-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 1000 2020-07-06 11:53:37.242 🔴-[TSLocationManager stopUpdatingLocation] 2020-07-06 11:53:37.244 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0 2020-07-06 11:53:37.244 📍<+[redacted],+[redacted]> +/- 122.64m (speed -1.00 mps / course -1.00) @ 06/07/2020, 11:53:37 Central European Summer Time 2020-07-06 11:53:37.244 ╔═══════════════════════════════════════════════════════════ ║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: 10.0m | age: 0.1s ╚═══════════════════════════════════════════════════════════ 2020-07-06 11:53:37.244 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 93.8 2020-07-06 11:53:37.245 📍<+[redacted],+[redacted]> +/- 122.65m (speed -1.00 mps / course -1.00) @ 06/07/2020, 11:53:37 Central European Summer Time 2020-07-06 11:53:37.245 ╔═══════════════════════════════════════════════════════════ ║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: 10.0m | age: 0.0s ╚═══════════════════════════════════════════════════════════ 2020-07-06 11:53:37.245 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Δt since last: 0.1s 2020-07-06 11:53:37.380 📍<+[redacted],+[redacted]> +/- 122.64m (speed -1.00 mps / course -1.00) @ 06/07/2020, 11:53:37 Central European Summer Time 2020-07-06 11:53:37.380 ╔═══════════════════════════════════════════════════════════ ║ -[TSGeofenceManager evaluateProximity:] Found 1 / 1 within 2000 m ╚═══════════════════════════════════════════════════════════ 2020-07-06 11:53:37.382 🎾-[TSGeofenceManager startMonitoringGeofence:] HOME200 2020-07-06 11:53:37.389 🎾-[TSGeofenceManager requestLocation] 2020-07-06 11:53:37.394 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2020-07-06 11:53:47.181 🔵-[TSLocationManager onSuspend:] enabled? 1) 2020-07-06 11:53:47.194 ℹ️-[TSDBLogger db_save] Log committed 2020-07-06 11:53:47.721 🔵-[TSGeofenceManager locationManager:didUpdateLocations:] <+[redacted],+[redacted]> +/- 65.00m (speed -1.00 mps / course -1.00) @ 06/07/2020, 11:53:44 Central European Summer Time 2020-07-06 11:53:47.721 ╔═══════════════════════════════════════════════════════════ ║ -[TSGeofenceManager fireGeofenceEvent:] 📢ENTER Geofence: HOME200 ╚═══════════════════════════════════════════════════════════ 2020-07-06 11:53:47.739 ✅-[BackgroundTaskManager createBackgroundTask] 36 2020-07-06 11:53:47.739 🎾-[TSGeofenceEvent startLoiteringAt:callback:] Geofence DWELL start: HOME200 (1 s) 2020-07-06 11:53:48.831 🔵-[TSGeofenceEvent startLoiteringAt:callback:]_block_invoke loiteringDelay timer fired: HOME200 2020-07-06 11:53:48.832 🎾-[TSGeofenceManager requestLocation] 2020-07-06 11:53:48.862 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2020-07-06 11:53:52.207 🔵-[BackgroundTaskManager onResume:] Current preventSuspend tasks: 1 2020-07-06 11:53:52.207 🔵-[TSLocationManager onResume:] enabled? 1 2020-07-06 11:53:52.208 ✅-[LocationDAO unlock]_block_invoke UNLOCKED ALL RECORDS 2020-07-06 11:53:52.208 ℹ️-[LocationDAO purge:] 1 2020-07-06 11:53:52.213 ℹ️-[TSDBLogger db_save] Log committed 2020-07-06 11:53:52.321 ╔═══════════════════════════════════════════════════════════ ║ -[TSHttpService flush:] ╚══════════════════════════════════════════════════════════════════════════ ║ -[TSHttpService flush:] ╚═════════════════════════════════════════════════════════\342══ 2020-07-06 11:53:52.321 ╔═══════════════════════════════════════════════════════════ ║ -[TSHttpService finish:error:] Success: 0 ╚═══════════════════════════════════════════════════════════ 2020-07-06 11:53:58.834 🔵-[TSGeofenceManager locationManager:didUpdateLocations:] <+[redacted],+[redacted]> +/- 65.00m (speed -1.00 mps / course -1.00) @ 06/07/2020, 11:53:55 Central European Summer Time 2020-07-06 11:53:58.835 ╔═══════════════════════════════════════════════════════════ ║ -[TSGeofenceManager fireGeofenceEvent:] 📢DWELL Geofence: HOME200 ╚═══════════════════════════════════════════════════════════ 2020-07-06 11:53:58.838 ✅-[BackgroundTaskManager createBackgroundTask] 57 2020-07-06 11:53:58.838 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 36 OF ( 36, 57 ) 2020-07-06 11:53:59.843 📍<+[redacted],+[redacted]> +/- 65.00m (speed -1.00 mps / course -1.00) @ 06/07/2020, 11:53:55 Central European Summer Time 2020-07-06 11:53:59.843 ╔═══════════════════════════════════════════════════════════ ║ -[TSGeofenceManager evaluateProximity:] Found 1 / 1 within 2000 m ╚════════════════════════════════════════════════════════════ ║ -[TSGeofenceManager evaluateProximity:] Found 1 / 1 within 2000 m ╚═══════════\342\225════════════════════════════════════════════════ 2020-07-06 11:53:59.846 🔵-[TSGeofenceManager evaluateProximity:delay:]_block_invoke Re-evaluation timer fired 2020-07-06 11:53:59.847 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 57 OF ( 57 ) 2020-07-06 11:54:11.002 🔵-[TSLocationManager onSuspend:] enabled? 1) 2020-07-06 12:05:13.260 ℹ️-[TSDBLogger db_delete] maxAge: 259200 2020-07-06 12:05:13.261 ℹ️-[TSLocationManager init] ╔═════════════════════════════════════════════ ║ TSLocationManager (build 359) ╠══════════════════════════════════════════════ { activityRecognitionInterval = 10000; activityType = 1; authorization = { }; autoSync = 1; autoSyncThreshold = 0; batchSync = 0; debug = 0; desiredAccuracy = "-1"; desiredOdometerAccuracy = 100; didLaunchInBackground = 0; disableAutoSyncOnCellular = 0; disableElasticity = 0; disableLocationAuthorizationAlert = 0; disableMotionActivityUpdates = 1; disableStopDetection = 0; distanceFilter = 10; elasticityMultiplier = 1; enableTimestampMeta = 0; enabled = 1; encrypt = 0; extras = { }; geofenceInitialTriggerEntry = 1; geofenceProximityRadius = 2000; geofenceTemplate = ""; headers = { }; heartbeatInterval = 60; httpRootProperty = location; httpTimeout = 60000; iOSHasWarnedLocationServicesOff = 0; isFirstBoot = 0; isMoving = 0; lastLocationAuthorizationStatus = 3; locationAuthorizationAlert = { cancelButton = Cancel; instructions = "To use background location, you must enable '{locationAuthorizationRequest}' in the Location Services settings"; settingsButton = Settings; titleWhenNotEnabled = "Background location is not enabled"; titleWhenOff = "Location services are off"; }; locationAuthorizationRequest = Always; locationTemplate = ""; locationTimeout = 60; locationsOrderDirection = ASC; logLevel = 5; logMaxDays = 3; maxBatchSize = "-1"; maxDaysToPersist = 1; maxRecordsToPersist = "-1"; method = POST; minimumActivityRecognitionConfidence = 70; odometer = 0; params = { }; pausesLocationUpdatesAutomatically = 1; persistMode = 0; preventSuspend = 0; schedule = ( ); schedulerEnabled = 0; showsBackgroundLocationIndicator = 0; startOnBoot = 1; stationaryRadius = 25; stopAfterElapsedMinutes = "-1"; stopDetectionDelay = 0; stopOnStationary = 0; stopOnTerminate = 0; stopTimeout = 5; trackingMode = 0; url = ""; useSignificantChangesOnly = 0; } 2020-07-06 12:05:13.263 ℹ️-[GeofenceDAO init] CREATE TABLE IF NOT EXISTS geofences (id INTEGER PRIMARY KEY AUTOINCREMENT, identifier TEXT NOT NULL UNIQUE, latitude DOUBLE NOT NULL, sin_latitude DOUBLE NOT NULL, cos_latitude DOUBLE NOT NULL, longitude DOUBLE NOT NULL, sin_longitude DOUBLE NOT NULL, cos_longitude DOUBLE NOT NULL, radius DOUBLE NOT NULL, notifyOnEntry BOOLEAN NOT NULL DEFAULT 0, notifyOnExit BOOLEAN NOT NULL DEFAULT 0, notifyOnDwell BOOLEAN NOT NULL DEFAULT 0, loiteringDelay DOUBLE NOT NULL DEFAULT 0, extras TEXT) 2020-07-06 12:05:13.263 ℹ️-[GeofenceDAO init] CREATE index IF NOT EXISTS identifier ON geofences (identifier);CREATE index IF NOT EXISTS latitude ON geofences (latitude);CREATE index IF NOT EXISTS longitude ON geofences (longitude);CREATE index IF NOT EXISTS sin_latitude ON geofences (sin_latitude);CREATE index IF NOT EXISTS cos_latitude ON geofences (cos_latitude);CREATE index IF NOT EXISTS sin_longitude ON geofences (sin_longitude);CREATE index IF NOT EXISTS cos_longitude ON geofences (cos_longitude); 2020-07-06 12:05:13.281 🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 3 2020-07-06 12:05:13.294 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2020-07-06 12:05:13.295 🔴-[TSGeofenceManager locationManager:didExitRegion:] HOME200 2020-07-06 12:05:13.295 🎾-[TSGeofenceManager requestLocation] 2020-07-06 12:05:13.295 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2020-07-06 12:05:13.295 🔵-[BackgroundTaskManager locationManager:didChangeAuthorizationStatus:] 3 2020-07-06 12:05:13.309 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2020-07-06 12:05:13.310 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2020-07-06 12:05:13.310 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2020-07-06 12:05:51.174 🎾-[TSGeofenceManager locationManager:didEnterRegion:] HOME200 2020-07-06 12:06:29.489 🔴-[TSGeofenceManager locationManager:didExitRegion:] HOME200 2020-07-06 12:06:45.974 🔵-[TSLocationManager onResume:] enabled? 1 2020-07-06 12:06:45.994 ℹ️-[TSLocationManager doStart:] trackingMode: 0 2020-07-06 12:06:45.995 ℹ️-[TSLocationManager clearLastOdometerLocation] 2020-07-06 12:06:45.995 🎾-[TSGeofenceManager start] 2020-07-06 12:06:45.995 🔵-[TSLocationManager setPace:] 0 2020-07-06 12:06:45.996 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 2020-07-06 12:06:45.997 ✅-[LocationDAO unlock]_block_invoke UNLOCKED ALL RECORDS 2020-07-06 12:06:45.997 ℹ️-[LocationDAO purge:] 1 2020-07-06 12:06:46.002 ╔═══════════════════════════════════════════════════════════ ║ -[TSHttpService flush:] ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:06:46.002 ╔═══════════════════════════════════════════════════════════ ║ -[TSHttpService finish:error:] Success: 0 ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:06:46.002 ℹ️-[TSDBLogger db_save] Log committed 2020-07-06 12:06:46.016 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2020-07-06 12:06:46.016 🎾-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON 2020-07-06 12:06:46.017 ╔═══════════════════════════════════════════════════════════ ║ -[TSHttpService flush:] ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:06:46.017 ╔═══════════════════════════════════════════════════════════ ║ -[TSHttpService finish:error:] Success: 0 ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:06:46.032 ℹ️-[TSLocationManager startMonitoringBackgroundFetch]_block_invoke Configured BackgroundFetch 2020-07-06 12:06:46.039 🔴-[TSGeofenceManager locationManager:didExitRegion:] HOME200 2020-07-06 12:06:46.072 🔵-[TSGeofenceManager locationManager:didUpdateLocations:] <+[redacted],+[redacted]> +/- 65.76m (speed -1.00 mps / course -1.00) @ 06/07/2020, 12:06:29 Central European Summer Time 2020-07-06 12:06:46.072 ╔═══════════════════════════════════════════════════════════ ║ -[TSGeofenceManager fireGeofenceEvent:] 📢EXIT Geofence: HOME200 ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:06:46.072 ╔═══════════════════════════════════════════════════════════ ║ -[TSGeofenceManager fireGeofenceEvent:] 📢ENTER Geofence: HOME200 ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:06:46.074 ✅-[BackgroundTaskManager createBackgroundTask] 10 2020-07-06 12:06:46.074 🎾-[TSGeofenceEvent startLoiteringAt:callback:] Geofence DWELL start: HOME200 (1 s) 2020-07-06 12:06:46.075 ╔═══════════════════════════════════════════════════════════ ║ -[TSGeofenceManager fireGeofenceEvent:] 📢EXIT Geofence: HOME200 ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:06:46.087 📍<+[redacted],+[redacted]> +/- 65.00m (speed -1.00 mps / course -1.00) @ 06/07/2020, 12:06:40 Central European Summer Time 2020-07-06 12:06:46.087 ╔═══════════════════════════════════════════════════════════ ║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 6.0s ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:06:46.087 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Received stale motionchange location. Retrying... 2020-07-06 12:06:46.096 📍<+[redacted],+[redacted]> +/- 65.00m (speed -1.00 mps / course -1.00) @ 06/07/2020, 12:06:46 Central European Summer Time 2020-07-06 12:06:46.096 ╔═══════════════════════════════════════════════════════════ ║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 0.0s ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:06:46.096 ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+[redacted],+[redacted]> +/- 65.00m (speed -1.00 mps / course -1.00) @ 06/07/2020, 12:06:46 Central European Summer Time 2020-07-06 12:06:46.096 🔵-[TSGeofenceManager didBecomeStationary:] TSGeofenceManager became stationary with outstanding loitering timers. Firing all loitering geofences 2020-07-06 12:06:46.096 ╔═══════════════════════════════════════════════════════════ ║ -[TSGeofenceManager fireGeofenceEvent:] 📢DWELL Geofence: HOME200 ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:06:46.096 🔵-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 1000 2020-07-06 12:06:46.097 🔴-[TSLocationManager stopUpdatingLocation] 2020-07-06 12:06:46.242 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0 2020-07-06 12:06:46.242 📍<+[redacted],+[redacted]> +/- 65.00m (speed -1.00 mps / course -1.00) @ 06/07/2020, 12:06:46 Central European Summer Time 2020-07-06 12:06:46.242 ╔═══════════════════════════════════════════════════════════ ║ -[TSGeofenceManager evaluateProximity:] Found 1 / 1 within 2000 m ╚════════════════════════════════════════════════════════════ ║ -[TSGeofenceManager evaluateProximity:] Found 1 / 1 within 2000 m ╚═══\342════════════════════════════════════════════════════════ 2020-07-06 12:06:46.245 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 10 OF ( 10 ) 2020-07-06 12:06:52.909 🔵-[TSLocationManager onSuspend:] enabled? 1) 2020-07-06 12:06:52.912 ℹ️-[TSDBLogger db_save] Log committed 2020-07-06 12:10:03.733 🎾-[TSGeofenceManager locationManager:didEnterRegion:] HOME200 2020-07-06 12:10:03.734 🎾-[TSGeofenceManager requestLocation] 2020-07-06 12:10:03.743 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2020-07-06 12:10:13.793 🔵-[TSGeofenceManager locationManager:didUpdateLocations:] <+[redacted],+[redacted]> +/- 48.00m (speed 6.25 mps / course -1.00) @ 06/07/2020, 12:10:12 Central European Summer Time 2020-07-06 12:10:13.794 ╔═══════════════════════════════════════════════════════════ ║ -[TSGeofenceManager fireGeofenceEvent:] 📢ENTER Geofence: HOME200 ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:10:13.799 ✅-[BackgroundTaskManager createBackgroundTask] 26 2020-07-06 12:10:13.799 🎾-[TSGeofenceEvent startLoiteringAt:callback:] Geofence DWELL start: HOME200 (1 s) 2020-07-06 12:10:14.825 🔵-[TSGeofenceEvent startLoiteringAt:callback:]_block_invoke loiteringDelay timer fired: HOME200 2020-07-06 12:10:14.825 🎾-[TSGeofenceManager requestLocation] 2020-07-06 12:10:14.839 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2020-07-06 12:10:16.808 🔵-[BackgroundTaskManager startPreventSuspendTimer:] BG time remaining: 27 | Total tasks: 1 2020-07-06 12:10:24.855 🔵-[TSGeofenceManager locationManager:didUpdateLocations:] <+[redacted],+[redacted]> +/- 12.00m (speed 3.65 mps / course 131.87) @ 06/07/2020, 12:10:23 Central European Summer Time 2020-07-06 12:10:24.856 ╔═══════════════════════════════════════════════════════════ ║ -[TSGeofenceManager fireGeofenceEvent:] 📢DWELL Geofence: HOME200 ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:10:24.860 ✅-[BackgroundTaskManager createBackgroundTask] 27 2020-07-06 12:10:24.861 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 26 OF ( 26, 27 ) 2020-07-06 12:10:25.956 📍<+[redacted],+[redacted]> +/- 12.00m (speed 3.65 mps / course 131.87) @ 06/07/2020, 12:10:23 Central European Summer Time 2020-07-06 12:10:25.956 ╔═══════════════════════════════════════════════════════════ ║ -[TSGeofenceManager evaluateProximity:] Found 1 / 1 within 2000 m ╚════════════════════════════════════════════════════════════ ║ -[TSGeofenceManager evaluateProximity:] Found 1 / 1 within 2000 m ╚═════════════════════════════\342\225══════════════════════════════ 2020-07-06 12:10:25.961 🔵-[TSGeofenceManager evaluateProximity:delay:]_block_invoke Re-evaluation timer fired 2020-07-06 12:10:25.961 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 27 OF ( 27 ) 2020-07-06 12:10:25.973 ℹ️-[TSDBLogger db_save] Log committed 2020-07-06 12:11:07.843 🔵-[TSLocationManager onResume:] enabled? 1 2020-07-06 12:11:07.851 ℹ️-[LocationDAO purge:] 1 2020-07-06 12:11:07.873 ℹ️-[TSDBLogger db_save] Log committed 2020-07-06 12:11:07.986 ╔═══════════════════════════════════════════════════════════ ║ -[TSHttpService flush:] ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:11:07.986 ╔═══════════════════════════════════════════════════════════ ║ -[TSHttpService finish:error:] Success: 0 ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:11:12.453 🔵-[TSLocationManager onSuspend:] enabled? 1) 2020-07-06 12:11:12.456 ℹ️-[TSDBLogger db_save] Log committed 2020-07-06 12:11:35.802 🔵-[TSLocationManager onResume:] enabled? 1 2020-07-06 12:11:35.812 ℹ️-[LocationDAO purge:] 1 2020-07-06 12:11:35.816 ℹ️-[TSDBLogger db_save] Log committed 2020-07-06 12:11:35.879 ╔═══════════════════════════════════════════════════════════ ║ -[TSHttpService flush:] ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:11:35.879 ╔═══════════════════════════════════════════════════════════ ║ -[TSHttpService finish:error:] Success: 0 ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:11:44.704 🔵-[TSLocationManager onSuspend:] enabled? 1) 2020-07-06 12:11:44.716 ℹ️-[TSDBLogger db_save] Log committed 2020-07-06 12:13:15.808 🔵-[TSLocationManager onResume:] enabled? 1 2020-07-06 12:13:15.819 ℹ️-[LocationDAO purge:] 1 2020-07-06 12:13:15.832 ℹ️-[TSDBLogger db_save] Log committed 2020-07-06 12:13:15.908 ╔═══════════════════════════════════════════════════════════ ║ -[TSHttpService flush:] ╚═══════════════════════════════════════════════════════════ 2020-07-06 12:13:15.908 ╔═══════════════════════════════════════════════════════════ ║ -[TSHttpService finish:error:] Success: 0 ╚════════════════════════════════════════════════════════════════════ ║ -[TSHttpService finish:error:] Success: 0 ╚════════════════════════════════════════════════════════\342═══ 2020-07-06 12:13:17.751 🔵-[TSLocationManager onSuspend:] enabled? 1) 2020-07-06 12:22:47.332 ℹ️-[TSDBLogger db_delete] maxAge: 259200 ```
christocracy commented 4 years ago

Set notifyOnDwell: false and try again.

FrikkieSnyman commented 4 years ago

Yeah that seems to have worked. Why is this happening?

christocracy commented 4 years ago

Why is this happening?

Because of a bug. It is fixed currently in the private repo. Have you purchased a license?

FrikkieSnyman commented 4 years ago

No, not yet. We're evaluating the plugin for our use cases, so this is good to know. Are any of these "broken but fixed" bugs listed somewhere?

christocracy commented 4 years ago

Are any of these "broken but fixed" bugs listed somewhere?

Yes, in the private repo's CHANGELOG. You'll have access to the private repo after purchase. This public repo gets mirrored from the private "customers only" repo only about every 3 months.