FG
💻 Software📱 Mobile & Cross-Platform

Add support for AlarmManager in Timing to allow proper handling of long timers

Freshover 6 years ago
Mar 14, 20260 views
Confidence Score79%
79%

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

Canonical Fix
High Confidence Fix
74% confidence92% success rate9 verificationsLast verified Mar 14, 2026

Solution: Add support for AlarmManager in Timing to allow proper handling of long timers

Low Risk

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

74

Trust Score

9 verifications

92% success
  1. 1

    I am getting following warning while using firebase library

    I am getting following warning while using firebase library

  2. 2

    `Setting a timer for a long period of time, i.e. multiple minutes, is a performa

    (Saw setTimeout with duration 111862ms)`

  3. 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

Worked: 9
Partial: 2
Failed: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

react-nativemobileiosandroidjavascriptplatform:-androidbug