-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Help Wanted]: Polygone geofencing event:EXIT is not trigger in Android #1411
Comments
Show me the exact polygon vertices you’re using. |
As text, not a screenshot. I need to copy/paste them |
[
[-36.72635, 174.715286],
[-36.726152, 174.716547],
[-36.726782, 174.716048],
[-36.727422, 174.716467],
[-36.727655, 174.715737],
[-36.72635, 174.715286]
] |
You cannot have an |
It already triggered ENTER event but EXIT event is still not triggered. Please check the logger blow.. Thank you D/TSLocationManager( 4404): [c.t.l.service.AbstractService a] |
Why do you keep calling .addGeofence?
|
I used .addGeofences once to register the geofence boundary in backgroundGeolocation. |
I use the same logic to add the circle geofence and polygon geofence, only the problem is occurred in polygon.. |
Avoid recreating an already existing geofence. |
I do not recreating the existing geofence.. how I know the geofences are recreating from the log? |
|
Using geofenceExists to check there is existing geofence or not and then add geofences. But stil the check out is not triggered.
|
It seems like 'Persist monitored polygons' is empty and 'clearPolygon' was running in logs when try to exit. Is that correct process? Could this be the reason why the exit event is not triggered? D/TSLocationManager( 4404): [c.t.l.service.AbstractService a] |
Yes. The way this plugin works is to wrap a polygon within a native circular geofence (ie: "the containing geofence of polygon"), represented below as green containing circles of the blue-dotted polygons. ![]() When the device enter the green circle (the "containing geofence"), the plugin initiates aggressive location monitoring, using each location to "hit test" upon the polygon:
Once the device exits the "containing geofence", the plugin halts its aggressive hit-testing algorithm, represented in the logs as:
This explained in the API docs |
How do I listen this event then? It is not able to triggered even using onLocation in BackgroundGeolocation. Please let me know how do I updated it for polygon. bg.BackgroundGeolocation.onLocation( |
That’s not how you listen to geofence events. Read the api docs event .onGeofence. Also read the “Geofencing Guide”, linked throughout. |
Required Reading
Plugin Version
4.16.6
Mobile operating-system(s)
What do you require assistance about?
The circle geofencing is working well as I expect - get the events from the trigger about Enter and Exit. But, the ploygon geofecing is not able to listen 'Exit' event. It is working after reloading the app only to get Exit event from ploygon geofence.
How do I listen the 'Exit' event directly without reloading the app as the circle geofence one?
[Optional] Plugin Code and/or Config
[Optional] Relevant log output
The text was updated successfully, but these errors were encountered: