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.58k stars 425 forks source link

Bug in dwell events and loitering delay on iOS #1450

Open andreshsingh opened 2 years ago

andreshsingh commented 2 years ago

I created a geofence with radius 500m and with loiteringDelay as 900000ms (15mins). I had the app running on all times. When the app was stationary or with very little movement, the dwell event was fired after the exact loitering delay time. But if i continued activity and kept walking with the phone on, the dwell event fires as soon as the phone detects movement (when the location cursor shows up in the statusbar).

Your Environment

import { P1, Height, Container, PrimaryButton, } from '@components'; import { getLocation } from '@helpers/backgroundLocation';

const GeofenceTestController = () => {

const [location, setLocation] = React.useState({ lat: null, long: null, }) const [enabled, setEnabled] = React.useState(null); const [geofences, setGeofences] = React.useState(''); const [requesting, setRequesting] = React.useState(false);

React.useEffect(() => {

const getCurrentLocation = async () => {
  const location = await getLocation();
  setLocation({
    lat: location.coords.latitude,
    long: location.coords.longitude
  })
}

getCurrentLocation();

}, []);

React.useEffect(() => { const _getGeofenceState = async () => { const state = await BackgroundGeolocation.getState(); setEnabled(state.enabled); const geofences = await BackgroundGeolocation.getGeofences(); setGeofences(JSON.stringify(geofences, null, 2)); } _getGeofenceState(); }, [requesting]);

const _handleGeofenceButtonPress = async () => { setRequesting(true); try { if (enabled) { await BackgroundGeolocation.stop(); await BackgroundGeolocation.removeGeofences(); } else { await BackgroundGeolocation.addGeofence({ latitude: location.lat, longitude: location.long, notifyOnExit: true, notifyOnEntry: true, identifier: TEST, radius: 200, notifyOnDwell: false, loiteringDelay: 0, }) await BackgroundGeolocation.startGeofences(); } } finally { const geofences = await BackgroundGeolocation.getGeofences(); setGeofences(JSON.stringify(geofences, null, 2)); setRequesting(false); } };

const _handleAddGeofence = async () => { try { await BackgroundGeolocation.addGeofence({ radius: 1000, notifyOnExit: true, notifyOnDwell: true, loiteringDelay: 900000, latitude: location.lat, longitude: location.long, identifier: 'TEST-TERTIARY', }) } finally { const geofences = await BackgroundGeolocation.getGeofences(); setGeofences(JSON.stringify(geofences, null, 2)); } };

if (location.lat && location.long && enabled !== null) { return (

{ !!geofences && }
)

} return ( null ); }

export default GeofenceTestController;



## Expected Behavior
<!--- Tell us what should happen -->
The dwell event should have been emitted after 15 mins.

## Actual Behavior
<!--- Tell us what happens instead -->
The dwell event was emitted as soon as the phone picked up location change

## Steps to Reproduce
<!--- reproduce this issue; include code to reproduce, if relevant -->
1. Call ready function
2. Add a geofence with loitering delay
3. Start moving as soon as the geofence is added

## Context
<!--- What were you trying to do? -->
I am trying to implement infinite geofencing. When the user exits a primary geofence, a secondary geofence is created with a loitering delay and the dwell event is captured if he stays longer than 15 mins. If the user exits the secondary geofence, a new geofence is created every time. If the user enters the primary geofence, all his secondary geofences are removed.

</details>
christocracy commented 2 years ago

Show me plugins logs where this occurs. See Wiki Debugging to learn how to use the .emailLog method to retrieve plugin's log file.

andreshsingh commented 2 years ago

{
    activityRecognitionInterval = 10000;
    activityType = 1;
    authorization =     {
    };
    autoSync = 1;
    autoSyncThreshold = 0;
    batchSync = 0;
    debug = 0;
    desiredAccuracy = "-1";
    desiredOdometerAccuracy = 100;
    didDeviceReboot = 0;
    didLaunchInBackground = 0;
    didRequestUpgradeLocationAuthorization = 1;
    disableAutoSyncOnCellular = 0;
    disableElasticity = 0;
    disableLocationAuthorizationAlert = 1;
    disableMotionActivityUpdates = 0;
    disableStopDetection = 0;
    distanceFilter = 10;
    elasticityMultiplier = 1;
    enableTimestampMeta = 0;
    enabled = 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 = 2;
    preventSuspend = 1;
    schedule =     (
    );
    schedulerEnabled = 0;
    showsBackgroundLocationIndicator = 0;
    startOnBoot = 0;
    stationaryRadius = 25;
    stopAfterElapsedMinutes = "-1";
    stopDetectionDelay = 0;
    stopOnStationary = 0;
    stopOnTerminate = 1;
    stopTimeout = 5;
    trackingMode = 0;
    url = "";
    useSignificantChangesOnly = 0;
}

2022-02-22 10:26:03.589 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2022-02-22 10:26:03.589 🎾-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON

2022-02-22 10:26:03.593 ℹ️-[TSLocationManager startMonitoringBackgroundFetch]_block_invoke Configured BackgroundFetch

2022-02-22 10:26:03.601 
πŸ“<+27.72450793,+85.32326662> +/- 46.06m (speed -1.00 mps / course -1.00) @ 21/02/2022, 11:48:16 Nepal Time

2022-02-22 10:26:03.601 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 81466.8s
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:26:03.601 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Received stale motionchange location.  Retrying...

2022-02-22 10:26:03.607 βœ…-[SOMotionDetector startDetection]_block_invoke Enabled M7 MotionActivity updates

2022-02-22 10:26:03.609 
πŸ“<+27.72460304,+85.32288508> +/- 45.00m (speed -1.00 mps / course -1.00) @ 22/02/2022, 10:25:59 Nepal Time

2022-02-22 10:26:03.609 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 4.4s
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:26:03.609 βœ…-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+27.72460304,+85.32288508> +/- 45.00m (speed -1.00 mps / course -1.00) @ 22/02/2022, 10:25:59 Nepal Time

2022-02-22 10:26:03.609 πŸ”΅-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 1000

2022-02-22 10:26:03.610 πŸ”΅-[TSLocationManager beginHeartbeat] 60

2022-02-22 10:26:03.610 πŸ”΄-[TSLocationManager stopUpdatingLocation] 

2022-02-22 10:26:03.610 πŸ”΅-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 45.0

2022-02-22 10:26:03.611 βœ…-[BackgroundTaskManager createBackgroundTask] 29

2022-02-22 10:26:03.612 
πŸ“<+27.72460304,+85.32288508> +/- 45.00m (speed -1.00 mps / course -1.00) @ 22/02/2022, 10:26:03 Nepal Time

2022-02-22 10:26:03.612 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: 10.0m | age: 0.0s
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:26:03.612 πŸ”΅-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 45.0

2022-02-22 10:26:03.612 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | on_foot/100 | isMoving: 1
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:26:03.787 
πŸ“<+27.72460304,+85.32288508> +/- 45.00m (speed -1.00 mps / course -1.00) @ 22/02/2022, 10:26:03 Nepal Time

2022-02-22 10:26:03.787 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSGeofenceManager evaluateProximity:] Found 1 / 1 within 2000 m
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:26:03.792 🎾-[TSGeofenceManager startMonitoringGeofence:] TEST

2022-02-22 10:26:03.800 🎾-[TSGeofenceManager requestLocation] 

2022-02-22 10:26:03.811 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2022-02-22 10:26:13.808 πŸ”΅-[TSGeofenceManager locationManager:didUpdateLocations:] <+27.72469780,+85.32288736> +/- 13.91m (speed 0.70 mps / course 320.33) @ 22/02/2022, 10:26:13 Nepal Time

2022-02-22 10:26:13.809 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSGeofenceManager fireGeofenceEvent:] πŸ“’ENTER Geofence: TEST
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:26:13.819 βœ…-[TSGeofenceManager fireGeofenceEvent:] INSERT: 80440884-E630-4926-9E6D-E2445088757E

2022-02-22 10:26:13.819 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSHttpService flush:] 
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:26:13.819 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSHttpService finish:error:] Success: 0
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:26:13.821 βœ…-[BackgroundTaskManager createBackgroundTask] 30

2022-02-22 10:26:14.829 
πŸ“<+27.72469780,+85.32288736> +/- 13.91m (speed 0.70 mps / course 320.33) @ 22/02/2022, 10:26:13 Nepal Time

2022-02-22 10:26:14.829 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSGeofenceManager evaluateProximity:] Found 1 / 1 within 2000 m
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:26:14.834 πŸ”΅-[TSGeofenceManager evaluateProximity:delay:]_block_invoke Re-evaluation timer fired

2022-02-22 10:26:14.835 βœ…-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 30 OF (
    29,
    30
)

2022-02-22 10:26:16.422 ℹ️-[GeofenceDAO doInsert:geofence:] TEST-TERTIARY

2022-02-22 10:26:16.637 
πŸ“<+27.72469780,+85.32288736> +/- 13.91m (speed 0.70 mps / course 320.33) @ 22/02/2022, 10:26:13 Nepal Time

2022-02-22 10:26:16.637 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSGeofenceManager evaluateProximity:] Found 2 / 2 within 2000 m
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:26:16.640 🎾-[TSGeofenceManager startMonitoringGeofence:] TEST-TERTIARY

2022-02-22 10:26:16.653 🎾-[TSGeofenceManager requestLocation] 

2022-02-22 10:26:16.677 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2022-02-22 10:26:26.635 πŸ”΅-[TSGeofenceManager locationManager:didUpdateLocations:] <+27.72470335,+85.32277465> +/- 13.30m (speed 0.89 mps / course 260.02) @ 22/02/2022, 10:26:26 Nepal Time

2022-02-22 10:26:26.638 βœ…-[BackgroundTaskManager createBackgroundTask] 31

2022-02-22 10:26:26.638 🎾-[TSGeofenceEvent startLoiteringAt:callback:] Geofence DWELL start: TEST-TERTIARY (900 s)

2022-02-22 10:26:56.968 ℹ️-[TSDBLogger db_save] Log committed

2022-02-22 10:27:03.555 πŸ”΅-[TSLocationManager onHeartbeat] Heartbeat

2022-02-22 10:27:03.557 πŸ”΅-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Query location-state will trigger in 10 seconds...

2022-02-22 10:27:13.557 🎾-[LocationManager requestLocation] ONESHOT

2022-02-22 10:27:23.563 
πŸ“<+27.72404340,+85.32217098> +/- 30.01m (speed 1.05 mps / course 156.20) @ 22/02/2022, 10:27:22 Nepal Time

2022-02-22 10:27:23.563 πŸ”΄-[LocationManager stopUpdatingLocation] OFF

2022-02-22 10:27:23.564 
╔═══════════════════════════════════════════════════════════
β•‘ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:27:23.570 
πŸ“<+27.72404340,+85.32217098> +/- 30.01m (speed 1.05 mps / course 156.20) @ 22/02/2022, 10:27:22 Nepal Time

2022-02-22 10:27:23.570 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSGeofenceManager evaluateProximity:] Found 2 / 2 within 2000 m
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:27:23.574 πŸ”΅-[TSLocationManager setPace:] 0

2022-02-22 10:27:23.578 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON

2022-02-22 10:27:23.591 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2022-02-22 10:27:23.591 βœ…-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 29 OF (
    29,
    31
)

2022-02-22 10:27:23.599 
πŸ“<+27.72404340,+85.32217098> +/- 30.01m (speed 1.05 mps / course 156.20) @ 22/02/2022, 10:27:22 Nepal Time

2022-02-22 10:27:23.599 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 1.0s
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:27:23.600 βœ…-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+27.72404340,+85.32217098> +/- 30.01m (speed 1.05 mps / course 156.20) @ 22/02/2022, 10:27:22 Nepal Time

2022-02-22 10:27:23.600 πŸ”΅-[TSGeofenceManager didBecomeStationary:] TSGeofenceManager became stationary with outstanding loitering timers.  Firing all loitering geofences

2022-02-22 10:27:23.600 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSGeofenceManager fireGeofenceEvent:] πŸ“’DWELL Geofence: TEST-TERTIARY
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:27:23.601 βœ…-[TSGeofenceManager fireGeofenceEvent:] INSERT: 552EB2F1-CC7B-4154-B309-445DD409118C

2022-02-22 10:27:23.601 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSHttpService flush:] 
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:27:23.601 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSHttpService finish:error:] Success: 0
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:27:23.602 πŸ”΅-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 1000

2022-02-22 10:27:23.602 πŸ”΄-[TSLocationManager stopUpdatingLocation] 

2022-02-22 10:27:23.602 πŸ”΅-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 45.0

2022-02-22 10:27:23.603 
πŸ“<+27.72404340,+85.32217098> +/- 30.01m (speed 1.05 mps / course 156.20) @ 22/02/2022, 10:27:22 Nepal Time

2022-02-22 10:27:23.603 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSGeofenceManager evaluateProximity:] Found 2 / 2 within 2000 m
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:27:23.607 
πŸ“<+27.72404340,+85.32217098> +/- 30.01m (speed 1.05 mps / course 156.20) @ 22/02/2022, 10:27:23 Nepal Time

2022-02-22 10:27:23.607 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: 10.0m | age: 0.0s
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:27:23.607 πŸ”΅-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 37.5

2022-02-22 10:27:23.609 
πŸ“<+27.72404340,+85.32217098> +/- 30.01m (speed 1.05 mps / course 156.20) @ 22/02/2022, 10:27:23 Nepal Time

2022-02-22 10:27:23.609 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSGeofenceManager evaluateProximity:] Found 2 / 2 within 2000 m
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:27:23.610 βœ…-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 31 OF (
    31
)

2022-02-22 10:27:26.969 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSLocationManager stop] 
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
andreshsingh commented 2 years ago
2022-02-22 10:26:13.809 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSGeofenceManager fireGeofenceEvent:] πŸ“’ENTER Geofence: TEST
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

2022-02-22 10:26:16.640 🎾-[TSGeofenceManager startMonitoringGeofence:] TEST-TERTIARY

2022-02-22 10:27:23.600 
╔═══════════════════════════════════════════════════════════
β•‘ -[TSGeofenceManager fireGeofenceEvent:] πŸ“’DWELL Geofence: TEST-TERTIARY
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

So here we can see that the loitering delay was set to 900s but it was fired after less than 1 min after start monitoring for the geofence TEST-TERTIARY

christocracy commented 2 years ago

TSGeofenceManager became stationary with outstanding loitering timers. Firing all loitering geofences

The plugin is designed to do this. If it did not fire dwell events when the plugin becomes stationary, it could not fire them at all.

Try this: create a geofence several hundred meters away from your current location. Go outside and walk into it with the plugin configured with debug: true (so you can hear and see debug notifications).

andreshsingh commented 2 years ago

Well i was walking the whole time and i didnt let the screen turn off. Do you find any possible reasons why the TSGeofenceMamanger became stationary ?

Also it seemed that the dwell event was fired after the phone detected location change or something (the location icon was shown in the statusbar before the event was fired).

andreshsingh commented 2 years ago

Actually the use case is to implement infinite geofencing and then track the location of the user on dwell after 15 mins. While implementing this as well i got the same result. The dwell event was fired in less time if the device is moving but it fires on time if the device is stationary.

andreshsingh commented 2 years ago

any updates on this @christocracy ? were you guys able to replicate the issue ?

christocracy commented 2 years ago

were you guys able to replicate the issue ?

Yes. There is a logic problem in geofencing-only mode .startGeofences() with dwell events. I have no estimate on fix date.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

andreshsingh commented 2 years ago

@christocracy any updates on this ?