Open Rajkumar1454 opened 4 months ago
I ran into this issue too, after 4 to 5 hours the service stops. There is no way to run your service 100% all the time with only one background service, more here . To get away way around it i use react-native-background-fetch to restart (turn on and off )the service every 5 min to seemingly make it run for a long time
Hi,
We are developing a Delivery Partner App using React Native version 0.73.6. The core functionality of our app requires constant access and tracking of the user's current location, even when the app is closed or running in the background.
To achieve this, we have integrated the
react-native-background-actions
library, version 4.0.1, and followed all the steps outlined in the documentation for Android.While the app does run in the background initially, we are facing issues with the app not staying in the background for an extended period across various Android devices. The duration for which the app remains active in the background is inconsistent and varies from device to device.
Here is a summary of our issue:
react-native-background-actions
library as per the documentation.Code Example:
AndroidManifest.xml:
Steps to Reproduce:
react-native-background-actions
in a React Native app.Expected Behavior: The app should run in the background indefinitely, consistently tracking the user's location across all Android devices.
Actual Behavior: The app runs in the background initially but stops after an unpredictable duration, varying across different Android devices.
Additional Information:
We would greatly appreciate any guidance or solutions to ensure our app remains active in the background consistently across all devices. What other permissions or configurations do we need to keep the app running in the background all the time?
Thank you!
Link to the
react-native-background-actions
documentation: react-native-background-actionsPlease let me know if any further information is required. @hkairi @mhmdnasser124 @mhmdnofal @Rapsssito @shergin @mdvacca