Add support for AlarmManager in Timing to allow proper handling of long timers
Problem
Setting timers for multiple minutes isn't handled properly in React Native on Android: it keeps the Timing module awake instead of relying on the system waking us up when the timer should go off. We should explore setting a cut off at which we delegate to AlarmManager and Handler.postDelayed instead of handling the timers using framecallbacks.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Add support for AlarmManager in Timing to allow proper handling of long timers
I am getting following warning while using firebase library `Setting a timer for a long period of time, i.e. multiple minutes, is a performance and correctness issue on Android as it keeps the timer module awake, and timers can only be called when the app is in the foreground. See https://github.com/facebook/react-native/issues/12981 for more info. (Saw setTimeout with duration 111862ms)` How to
Trust Score
9 verifications
- 1
I am getting following warning while using firebase library
I am getting following warning while using firebase library
- 2
`Setting a timer for a long period of time, i.e. multiple minutes, is a performa
(Saw setTimeout with duration 111862ms)`
- 3
How to get rid of this warning...
How to get rid of this warning...
Validation
Resolved in facebook/react-native GitHub issue #12981. Community reactions: 111 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep