react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

Headless routine working in background, when the app start

Open Kranysys opened this issue 7 years ago • 1 comments

Your Environment

  • Plugin version: 3.2.0
  • Platform: Android
  • OS version: 9.0
  • Device manufacturer / model: Nokia 7.1
  • React Native version (react-native -v): 0.60.4
  • Plugin config
  reset: true,
  desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
  disableElasticity: true,
  distanceFilter: 0,
  locationUpdateInterval: 1000,
  stopTimeout: 1,
  debug: true,
  logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
  stopOnTerminate: false,
  enableHeadless: true,
  startOnBoot: true,
  autoSync: true,
  batchSync: false,
  autoSyncThreshold: 0,

Expected Behavior

Using headless to make one routine working when the app start ( in background, in foreground, or when the app is minimized). This routine will be initiate one time, when the app start. Then this routine should then work 24h/24 in background.

Actual Behavior

Headless is working only when there is some events (HTTP, LOCATION, TERMINATE, HEARTBEAT, ...) but there is no way to use it when the app start, to initiate a routine in background only one time.

Steps to Reproduce

  1. BackgroundGeolocation.registerHeadlessTask(HeadlessTask); in index.js
  2. HeadlessTask in index.js with the routine inside

Context

Using the headless service of React Native Background Location.

Kranysys avatar Nov 20 '19 14:11 Kranysys

Restless is working only when there is some events

What is "Restless"?

christocracy avatar Nov 20 '19 21:11 christocracy