react-native-background-geolocation: Android heartbeatInterval is being ignored

Your Environment

  • Plugin version: 2.9.2
  • Platform: Android (with a license)
  • OS version: OSX
  • Device manufacturer / model: Simulator
  • React Native version (react-native -v): 47.2
  • Plugin config
{
      // Geolocation Config
      desiredAccuracy: 0,
      distanceFilter: 10,
      // Activity Recognition
      stopTimeout: 1,
      // Application config
      debug: false, // <-- enable this hear sounds for background-geolocation life-cycle.
      logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
      stopOnTerminate: false,   // <-- Allow the background-service to continue tracking when user closes the app.
      startOnBoot: true,     // <-- Auto start tracking when device is powered-up.
      preventSuspend: true,
      heartbeatInterval: 15,

    }

Expected Behavior

It should fire on the interval value

Actual Behavior

it fires after 60 seconds

Steps to Reproduce

  1. Use the config above and set a listener on the heartbeat event. it will fire every 60 seconds

Context

Monitor heartbeat events at a lower interval than 60 seconds.

Debug logs

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

react-native-background-timer uses postDelayed

You’ll find your timer not firing consistently after a period of time and when the device goes into Doze Mode

I’ve been doing this for over 4 years. I’ve seen it all.