react-native-background-timer
react-native-background-timer copied to clipboard
BackgroundTimer stops when app goes to background in Huawei devices
Hi, I am using this backgroud timer. It works perfectly in other devices. Timer works well in background and foreground as well. But, when it comes to huawei phones, timer stops in background. It works well in foreground. When I minimize the app or turn off the display, timer stops.
`let interval = BackgroundTimer.setInterval(async function () {
if (that.state.timeLeft > 0) {
await that.setState({ timeLeft: that.state.timeLeft - 1 }, function () {
if (this.state.timeLeft === 0) {
BackgroundTimer.clearInterval(interval);
that.resetWizard();
}
});
} else {
BackgroundTimer.clearInterval(interval);
that.resetWizard();
}
}, 60000);`
How can I make this work for huawei as well? Please help.
me too