Closed chris-eaheart closed 1 month ago
Are you actually creating geofences (with .addGeofence)?
I am not calling addGeofence anywhere in the code.
I am not calling addGeofence
Then you have no reason to expect .removeGeofences to do anything.
And you have no reason to listen to . onGeofence Or .onGeofencesChange
Ok, then the issue title doesn't accurately reflect the issue I'm having - I will close this issue and start a new one.
The plug-in does use an internal “stationary geofence” around the last known position, the exit of which signals that the device is moving. This geofence is crucial to the plug-in’s philosophy of operation. Particularly so since the Play Store has become very strict with allowing the motion api to launch foreground-services in the background.
This “stationary geofence” is what allows this plug-in to launch a foreground-service in the background and resume tracking. Android 14 has become very strict about when foreground-services can be launched.
Ok, that is helpful, and that is what I was referring to - so it is not possible to remove this, or reduce the size of it at least? I just want to get a bit more accuracy with the app I'm developing, and I'm finding this internal geofence to be limiting my ability to have the desired accuracy.
so it is not possible to remove this,
if you were able to “remove” the stationary geofence, nothing would work. Your app would lie dormant, suspended in the background.
or reduce the size of it at least?
The OS doesn’t respond to any geofence radius < ~200 meters. The plug-in applies a radius of 150. If you were to set a radius: 0, the OS would still only respond as if you set it to 200.
Geofences are monitored by the OS.
you are always free to manually engage tracking by calling .changePace(true) while your app is in the foreground, like a “Jogging App” with its [Start Workout] button.
We’re fortunate the OS continues to allow geofences to initiate location-tracking in the background.
react-native -v
): 0.73.2Expected Behavior
Geofences should not be created, and tracking should always pick up my latest location.
Actual Behavior
Geofences are being created - tracking is delayed until I move outside of the geofenced area.
Chris, just will refer you to your feedback from this issue: https://github.com/transistorsoft/react-native-background-geolocation/issues/833
You said if you do not want to track geofences, to remove them. I am removing them above in two events that seem most logical to remove them, but I am finding that geofences are still being created.
I am using your sample app on a physical device, and have modified the code as indicated above. The below is a walk I took just this morning - the red line indicates that initial part of that walk that was not tracked.