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.62k stars 428 forks source link

onGeofence not trigger running #2092

Closed nusjeff closed 1 week ago

nusjeff commented 1 month ago

Your Environment



## Expected Behavior
I'm running in a polygon but it don't trigger running
Function onGeofence will trigger running

## Actual Behavior
Function onGeofence will not trigger running

</details>
christocracy commented 1 month ago

See wiki “Debugging”. Learn to observe the plug-in logs.

The first thing to do when something unexpected happens is use debug: true and observe the plug-in’s incredibly verbose logs.

nusjeff commented 1 month ago

@christocracy I already did that, I work fine with the normal lat, long

identifier: Home
       latitude:  property.latitude,
       longitude:property.longitude,
       radius: radiusJob,

but with the polygon it not trigger

christocracy commented 1 month ago

Analyze your polygon shape. Plot the points on a map. The order of vertices matters.

nusjeff commented 1 month ago

Simulator Screenshot - iPhone 15 Pro Max - 2024-07-18 at 15 00 48 @christocracy this is my polygon, my location is in the center of the polygon as you can see in the picture, but the onGeofence not work, all polygon was add success and already on in onGeofencesChange

christocracy commented 1 month ago

Your polygon has 5 vertices. That doesn’t look like any kind of pentagon.

christocracy commented 1 month ago

The order of vertices matters. For example, making a square in the SampleApp:

IMG_1784

IMG_1785

christocracy commented 1 month ago

Use your map api to draw a polygon using your vertices.

nusjeff commented 1 month ago

Simulator Screenshot - iPhone 15 Pro Max - 2024-07-18 at 15 49 59 @christocracy I try using a square like you said, but it still not trigger running

 vertices: [
        [10.802129317156131, 106.64898325473482],
        [10.801897465135191, 106.6522233632248],
        [10.798862294898008, 106.65190149814302],
        [10.799073071599935, 106.64867211848909],
      ],
christocracy commented 1 month ago

Go outside and walk out of your polygon then walk back in. Use debug: true so you can hear the debug soundFX.

christocracy commented 1 month ago

reset: false,

Why are you using this? If you don’t know what it does, don’t use it.

github-actions[bot] commented 3 weeks ago

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

github-actions[bot] commented 1 week ago

This issue was closed because it has been inactive for 14 days since being marked as stale.