react-native-background-geolocation
react-native-background-geolocation copied to clipboard
Start headless task (or JS listeners) on device boot
Hi, I'm wondering if it's possible to start a headless/non-headless JS task listener on device boot. Starting the background service on device boot doesn't seem to help much since I can't act on the results of it. In particular, I'm recording boundary updates via react native async storage, and sending exact position to firebase. The background service starts after device boot, but doesn't retain any of the previously declared listeners. How can I recreate these on boot? Thanks!
Your Environment
- Plugin version:
- Platform: Android
- OS version: 10
- Device manufacturer and model: Google Pixel
- Running in Simulator: No
- React Native version: 0.60
This actually make sense. Worth implementing it.
My current (less than ideal) workaround is to just start the app in background on device boot, perform some checks to see if it's in a state that should be tracking location, and if so, start the background service. I can help with this on GitHelp
Dear @iocuydi and Dear @mauron85 i called registerHeadlessTask and i started it in java code but it's not useful. Because we should launch the app after reboot to load JS bundle and register our headless task from JS code !
+1