react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

DWELL / loiteringDelay is started but never ended on .startGeofences() IOS

Open sirusbaladi opened this issue 1 year ago • 4 comments

Your Environment

  • Expo
  • Plugin version: 4.16.5
  • Platform: iOS
  • OS version: 17.4.1
  • Device manufacturer / model: Iphone 13 pro
  • React Native version (react-native -v): "0.71.14
  • Plugin config BackgroundGeolocation.ready({ showsBackgroundLocationIndicator: false, stopTimeout: 10, debug: true, stationaryRadius: 100, logLevel: BackgroundGeolocation.LOG_LEVEL_OFF, logMaxDays: 0, distanceFilter: 1000, stopOnTerminate: false, startOnBoot: true, }).then((state) => { BackgroundGeolocation.startGeofences(); }

Expected Behavior

When I go into a geofence after I get: Geogence DWELL start: .. (480s), after 480s it should trigger DWELL

Actual Behavior

it triggers Geogence DWELL start: .. (480s) but then the app sleeps and never triggers DWELL unless I manually open the app.

It works well on .start() but not on .startGeofences().

Steps to Reproduce

  1. add a geofence with notifyOnDwell: true and loiteringDelay: 480000.
  2. walk in it
  3. I'm using debug mode

sirusbaladi avatar Aug 29 '24 01:08 sirusbaladi

Likely fixed while working on #2113 (in private repo branch mentioned in that issue).

christocracy avatar Aug 29 '24 01:08 christocracy

Likely fixed while working on #2113 (in private repo branch mentioned in that issue).

for radious geofences too? this issue is not for polygon geofences.

sirusbaladi avatar Aug 29 '24 01:08 sirusbaladi

Yes

christocracy avatar Aug 29 '24 01:08 christocracy

Yes

perfect, will test and update here (and close if it works).

sirusbaladi avatar Aug 29 '24 01:08 sirusbaladi

Yes

unfortunately this is still an issue. DWELL start and it never ends unless I manually open the app

sirusbaladi avatar Aug 29 '24 16:08 sirusbaladi

Configure logLevel for verbose logging. Fetch logs with .emailLog (see API docs)

christocracy avatar Aug 29 '24 16:08 christocracy

I added the full logs to the main post.

In particular you can see that DWELL should have triggered at 12:44 but it triggered when I opened the app at 12:47. I repeated the test multiple times giving it more space and it never triggers unless I open the app

╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-08-29 12:36:16.099 ✅-[BackgroundTaskManager createBackgroundTask] 59

2024-08-29 12:36:16.099 🎾-[TSGeofenceEvent startLoiteringAt:callback:] Geofence DWELL start: ChIJ2WEEbYRZwokRDTfV0NcZRnA (480 s)

2024-08-29 12:36:16.301 

[...]

╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/100 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2024-08-29 12:47:17.760 🔵-[TSGeofenceEvent startLoiteringAt:callback:]_block_invoke loiteringDelay timer fired: ChIJ2WEEbYRZwokRDTfV0NcZRnA

2024-08-29 12:47:17.760 🎾-[TSGeofenceManager requestLocation] 

2024-08-29 12:47:17.763 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-08-29 12:47:17.764 ℹ️-[TSDBLogger db_save] Log committed

2024-08-29 12:47:17.812 🔵-[TSLocationManager onResume:] enabled? 1

2024-08-29 12:47:17.828 ℹ️-[LocationDAO purge:] 1

2024-08-29 12:47:17.830 ℹ️-[TSDBLogger db_save] Log committed

2024-08-29 12:47:17.838 

╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceManager fireGeofenceEvent:] 📢DWELL Geofence: ChIJ2WEEbYRZwokRDTfV0NcZRnA
╚═══════════════════════════════════════════════════════════

2024-08-29 12:47:27.772 ✅-[TSGeofenceManager fireGeofenceEvent:] INSERT: C90AAFCA-E2F4-43B5-A724-94A772B16A9D

2024-08-29 12:47:27.772 

sirusbaladi avatar Aug 29 '24 16:08 sirusbaladi

Re-install with 4.17.0-beta.3

christocracy avatar Aug 29 '24 20:08 christocracy

Your deleted post is no longer relevant?

christocracy avatar Aug 29 '24 22:08 christocracy

Your deleted post is no longer relevant?

Correct, also wanted to test it in the field before commenting, which I just did, and it works great! Closing this since it's resolved.

sirusbaladi avatar Aug 30 '24 02:08 sirusbaladi