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

setTimeout only triggers when app is in foreground

Open Kaz-z opened this issue 4 years ago • 1 comments

Using Android 11 I've noticed when using a debug / release apk the setTimeout method only triggers when the app is in the foreground. For example using the following block of code:

const activateTimer= BackgroundTimer.setTimeout(() => { console.log('hello'); }, 1000);

the timer will start when the app is open and 'hello' will be logged fine. However when the app is backgrounded 'hello' will only get logged when the app is foregrounded.

Interestingly when the physical android device is attached and running in debug mode there are no problems and functionality is as expected.

Any help on this one?

Kaz-z avatar Aug 28 '21 16:08 Kaz-z

same issue

AftabUfaq avatar Feb 02 '22 10:02 AftabUfaq