transistorsoft / capacitor-background-geolocation

The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.
MIT License
86 stars 14 forks source link

No geofenceInitialTriggerExit #159

Closed SchallerStefan closed 1 year ago

SchallerStefan commented 1 year ago

Your Environment

Context

Our App needs to do something, when the geofence is either ENTER or EXIT. When creating a geofence and the user is in it, the geofence can send an ENTER event with "geofenceInitialTriggerEntry". But we would need that feature also, when the user is outside of the geofence, when it is created. (e.g. geofenceInitialTriggerExit)

Is there a clean way, to send an exit event on creation ONLY when geofenceInitialTriggerEntry does not fire?

christocracy commented 1 year ago

Is there a clean way, to send an exit event on creation ONLY when geofenceInitialTriggerEntry does not fire?

No. Measure the distance of the current location to your target geofence’s centre point.

if ((distance - geofenceRadius) >= 0), the device is outside the geofence.

SchallerStefan commented 1 year ago

Ok, thank you!