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.66k stars 426 forks source link

Demo app - BGLocation does not trigger onGeofence enter/exit events on polygon geofences #2168

Open BugraDemiral opened 1 month ago

BugraDemiral commented 1 month ago

Your Environment

Expected Behavior

Polygon geofences should trigger onGeofence events with polygon geofences as stated it is fully functional in debug mode.

Actual Behavior

Polygon geofence triggers native didEnterRegion and didExitRegion in native side but not triggering onGeofence event in RN

Steps to Reproduce

  1. Goto Advanced part of demo app - debug with Xcode
  2. Enable switch on top right
  3. Create a polygon geofence
  4. Trigger inside / outside location in geofence from Xcode

Context

Trying to simulate enter/exit to polygon geofence with gpx files on Xcode with real device.

Debug logs

Logs ``` ╔═══════════════════════════════════════════════════════════ ║ -[PolygonGeofencingService isInPolygon:] 📍 41.552363, 2.098692, acy: 5.0m ╚═══════════════════════════════════════════════════════════ ℹ️-[PolygonGeofencingService isInPolygon:] --> polygon test: 0.0% 🔴-[TSGeofenceManager locationManager:didExitRegion:] polygon test ╔═══════════════════════════════════════════════════════════ ║ -[PolygonGeofencingService didExitRegion:] EXIT containing geofence of polygon: polygon test ╚═══════════════════════════════════════════════════════════ 🔴-[PolygonGeofencingService stopMonitoring:] polygon test [Geofencing] clearPolygon polygon test ℹ️-[PolygonGeofencingService persistMonitoredPolygons] { } ℹ️-[PolygonGeofencingService resetStopTimeout] 🔴-[PolygonGeofencingService stopUpdatingLocation] 🎾-[TSGeofenceManager locationManager:didEnterRegion:] polygon test ╔═══════════════════════════════════════════════════════════ ║ -[PolygonGeofencingService didEnterRegion:] ENTER containing geofence of polygon: polygon test ╚═══════════════════════════════════════════════════════════ 🎾-[PolygonGeofencingService startMonitoring:] polygon test [Geofencing] loadPolygon polygon test ℹ️-[PolygonGeofencingService persistMonitoredPolygons] { "polygon test" = 0; } 🎾-[PolygonGeofencingService startUpdatingLocation:] 🎾-[PolygonGeofencingService beginStopTimeout] ℹ️+[LocationAuthorization run:onCancel:] status: 3 ╔═══════════════════════════════════════════════════════════ ║ -[PolygonGeofencingService isInPolygon:] 📍 41.557393, 2.109790, acy: 5.0m ╚═══════════════════════════════════════════════════════════ ℹ️-[PolygonGeofencingService isInPolygon:] --> polygon test: 100.0% ```
christocracy commented 1 month ago

How exactly are you testing this? Outside on a real device with real movement or in a simulator?

BugraDemiral commented 1 month ago

I'm testing it on my desk connected to Xcode with a physical device.

christocracy commented 1 month ago

Test on iOS simulator with location simulated with "Freeway Drive". Or go outside and test with real movement.

https://github.com/user-attachments/assets/0fa2ae45-450f-4401-9254-f9d0ff546be6

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 30 days with no activity.