Skip to main content

Overview

Checks if the app is currently exempt from battery optimizations. When an app is ignoring battery optimizations, it can run background tasks more freely without being restricted by Doze mode and App Standby.

Returns

isIgnoring
boolean
Promise resolving to true if the app is ignoring battery optimizations (exempt from Doze restrictions), false otherwise.

Platform Behavior

What Are Battery Optimizations?

Battery optimizations were introduced in Android 6.0 (API 23) as part of Doze mode. When an app is NOT ignoring battery optimizations, the system may:
  • ❌ Defer background work and jobs
  • ❌ Restrict network access when idle
  • ❌ Delay alarms and timers
  • ❌ Stop location updates
  • ❌ Prevent wake locks from working
When an app IS ignoring battery optimizations:
  • ✅ Background tasks run normally
  • ✅ Network access maintained
  • ✅ Wake locks function properly
  • ✅ Location updates continue

Example Usage

Check and Request Exemption

Startup Check

Status Display

Before Starting Background Service

Settings Screen

Difference from Power Save Mode

isIgnoringBatteryOptimizations() is different from isPowerSaveMode(): An app can be exempt from battery optimizations but still be affected when the user enables Power Save mode.