Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

[Android] Allow to set the notification to executes on idle #959

Merged
merged 1 commit into from
Apr 15, 2020

Conversation

hshiraiwa
Copy link

@hshiraiwa hshiraiwa commented Dec 7, 2018

On Android 6.0 (API level 23) and above in order to reduce battery consumption, the system enters in Doze mode while the device is unused for long periods of time.
While on Doze mode the AlarmManager alarms dont execute exactly on the scheduled time, they are deferred to the next maintenance window. This cause the notifications to show after their scheduled time.
This change adds a new attribute allowWhileIdle to allow the notification to be displayed while on doze

This behavior is documented on: https://developer.android.com/training/monitoring-device-state/doze-standby

@hshiraiwa hshiraiwa force-pushed the feat/allow-while-idle branch from e42a8e9 to 678e036 Compare December 7, 2018 17:43
On Android 6.0 (API level 23) and above in order to reduce battery
consumption, the system enters in Doze mode whilethe device is unused
for long periods of time.
While on Doze mode the AlarmManager alarms dont execute exactly on the
scheduled time, they are deferred to the next maintenance window. This
cause the notifications to show after their scheduled time.
This change adds a new attribute `allowWhileIdle` to allow the
notification to be displayed while on doze
@hshiraiwa hshiraiwa force-pushed the feat/allow-while-idle branch from 678e036 to 6cf060a Compare December 7, 2018 18:14
@cabelitos
Copy link

👍

Copy link

@mmccartney mmccartney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

mmccartney pushed a commit to mmccartney/react-native-push-notification that referenced this pull request Feb 15, 2019
@Dallas62 Dallas62 self-assigned this Apr 10, 2020
@Dallas62 Dallas62 merged commit 9e563df into zo0r:master Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants