ocetnik / react-native-background-timer

Emit event periodically (even when app is in the background)
MIT License
1.62k stars 230 forks source link

React Native Background Task Termination on Device Lock in Android OS <= 13 #527

Open Ambreen-Kanwal20 opened 7 months ago

Ambreen-Kanwal20 commented 7 months ago

Despite enabling battery optimization setting, I'm facing an issue in my React Native Android application where background tasks, managed by react-native-background-timer and react-native-background-actions, get terminated when the device is locked. This leads to the automatic closure of the application in the background.

The problem occurs specifically with the BackgroundTimer.setInterval function, which runs a countdown interval. When the device is locked, the background task abruptly ends after five minutes, disrupting the intended functionality of my application.

I'm seeking guidance or suggestions on how to prevent this termination of background tasks when the device is locked, ensuring uninterrupted operation of critical functionalities.

Any assistance or insights would be greatly appreciated. Thank you.

ReddyyZ commented 7 months ago

Same issue here

SuPeRZ66 commented 2 weeks ago

Same issue here ,react-native0.76 ,android os 14