react-native -v): 0.52.0distanceFilter: 10,
locationUpdateInterval: 1000,
stopOnTerminate: true,
startOnBoot: false,
foregroundService: false,
debug: false,
The BackgroundGeolocation.on('location') should be triggered on each location change
The BackgroundGeolocation.on('location') stops being triggered after 4 or 5 changes.
I want to trigger an API call on each location change in order to track a user location but only the first changes are being triggered. Even the GPS Data Playback having a really huge path to follow. It only triggers the first 4 or 5 changes and then stops to trigger. If opening the Google Maps, I can see my position being tracked through the whole path when using the same GPS Data Playback.
https://pastebin.com/raw/K3JchhGG
Obs.: I've debugged as "[LOCSERVICE]" on each time a BackgroundGeolocation callback is triggered.
If checking the log itself, you may see that the last LOCSERVICE log triggering a location was on 01-25 14:02:19.270.
The GPS Data Playback was still running at that time. And I've kept logging 2min later. With no more LOCSERVICES being triggered showing the next locations.
Although there is a...
TSLocationManager: [c.t.l.BackgroundGeolocationService onActivityRecognitionResult] still (100%)
... before stopping that it suggests it recognized the device as "still". The problem is that the GPS Data Playback was still running.
The plugin uses MotionActivity API (uses gyroscope/accelerometer/compass) to determine when to listen to locations.
If the MotionActivity API says the plugin is stationary, the plugin isn't listening to locations.
If you want to test in Simulator (or mock location app, such as Lockito), you must manually put the plugin into the moving state via BackgroundGeolocation.changePace(true);
@christocracy , thanks for your feedback!

I'm setting the changePace(true) after BackgroundGeolocation.start but stills the same behavior.
Is there a specific moment to activate the changePace?
Cheers!
Currently, even with changePace(true) he stills logs an activity change as
[LOCSERVICE] [activity change]{"confidence":100,"activity":"still"}
The plugin persists state.enabled. Your if (!state.enabled) {} block isn't evaluating because state.enbled === true If you execute #start and reboot the app, state.enabled === true
The activity comes from the motion-activity API (accelerometer,gyroscope,compass). If the device isn't moving, it will always be still.
BackgroundGeolocation.configure(config, (state) => {
BackgroundGeolocation.changePace(true);
});
Hi @christocracy !
Thanks for your feedback. It helped solve my problem!
@christocracy Please let me know if I should create a new issue.
changePace(true) just once after setConfig and not necessary in setInterval()?changePace(true) _once_ to force geolocation updates?start() without checking if state.enabled === true?@iamjoyce Have you read the Philosophy of Operation?
The plugin strongly desires to be in the stationary state. When you execute changePace(true), the plugin enters the moving state. When the Motion API says the device is still, the plugin engages the stopTimeout timer.
When the stopTimeout timers expires, the plugin automatically switches back to stationary state (essentially executing changePace(false) upon itself).
No, you don't need setInterval.
Is there any repercussion if I were to call start()
No, the plugin will simply ignore your attempt to #start when already enabled. In the logs, you'll see:
鈿狅笍 Already started. Ignored
Most helpful comment
Hi @christocracy !
Thanks for your feedback. It helped solve my problem!