react-native-background-geolocation
react-native-background-geolocation copied to clipboard
Headless routine working in background, when the app start
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
- BackgroundGeolocation.registerHeadlessTask(HeadlessTask); in index.js
- HeadlessTask in index.js with the routine inside
Context
Using the headless service of React Native Background Location.
Restless is working only when there is some events
What is "Restless"?