Closed sirusbaladi closed 2 weeks ago
DWELL / loiteringDelay
It’s not implemented yet.
DWELL / loiteringDelay
It’s not implemented yet.
Any timeline?
We are launching the app this saturday and I was convinced that polygon geofence had dwell. It's a core feature.
Any timeline?
No. This winter perhaps.
You’re free to run your own timers in the onGeofence enter event.
You’re free to run your own timers in the onGeofence enter event.
Would you say something like this will work? In the if statement with event.vertices to make it happen only for polygon geofences.
I wonder if an 8 minutes times is okay.
BackgroundGeolocation.onGeofence((event) => {
if (event.action === "ENTER" && event.vertices) {
BackgroundGeolocation.startBackgroundTask().then((taskId) => {
setTimeout(() => {
console.log("DWELL");
BackgroundGeolocation.stopBackgroundTask(taskId);
}, 8 * 60 * 1000); // 8 minutes in milliseconds
}).catch((error) => {
console.error("Error starting background task:", error);
});
}
});
or do you have a better way while waiting for the proper plugin implementation?
You should keep a reference to your timerId so you can cancel it if EXIT occurs before timer expires. You’d need to keep a Hash of timers keyed on geofence.identifier.
8 min is kind of long.
const timerId = setTimeout(…)
DWELL_TIMERS[identifer] = timerId
I see, thank you.
But I wonder if this will work at all. In the documentation it says that startBackgroundTask() will only work for 180 seconds and my timer is 8 minutes.
For non polygon geofences setting loiteringDelay to 8 minutes works great and never failed but I suspect it uses a different mechanism
When the plug-in enters the containing geofence of a polygon, it turns ON location-services.
when location-services are ON, your app is completely alive in the background, just as if it were in the foreground.
there’s no need for background-tasks.
When the plug-in enters the containing geofence of a polygon, it turns ON location-services.
when location-services are ON, your app is completely alive in the background, just as if it were in the foreground.
there’s no need for background-tasks.
even if .startGefence?
even if .startGefence?
Yes. But since I've been working on polygon-geofencing for the last week+, I've decided to implement notifyOnDwell
for polygon geofences.
even if .startGefence?
Yes. But since I've been working on polygon-geofencing for the last week+, I've decided to implement
notifyOnDwell
for polygon geofences.
oh awesome! and is this already released? how to get it?
I’ll let you know when it’s pushed to the private repo.
See #2113 (this comment)
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Your Environment
react-native -v
): "0.71.14Expected Behavior
When I go into a polygon geofence I should receive geofence: DWELL
Actual Behavior
I do receive geofence: DWELL for my radius geofences.
For polygon Geofences it only detecs enter / exit.
Steps to Reproduce