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.54k stars 424 forks source link

onMotionChange doesn't trigger properly with stopTimeout #1982

Closed socheatleang closed 1 month ago

socheatleang commented 1 month ago

onMotionChange doesn't trigger when with the configuration with stopTimeOut.

Your Environment

Expected Behavior

When I use stopTimeout with a value of 10, I expect the onMotionChange to be triggered if the user doesn't move for 10 minutes.

Actual Behavior

onMotionChange hit only I trigger changePace.

Steps to Reproduce

  1. Start the service
  2. Go out and walk with physical device for 40mn and stop move for 15mn.
  3. And continue to walk

Context

I am sure that I subscribed to the motion after .ready(). I try to put the phone on the desk without movement, the onMotionChange still doesn't hit.

christocracy commented 1 month ago

Delete the following items from your Config then go test again:

disableStopDetection: true, pausesLocationUpdatesAutomatically: false,

socheatleang commented 1 month ago

@christocracy Thanks.

christocracy commented 1 month ago

Read those two config options to yourself: It should become obvious why deleting those options is the solution.