Skip to content

'androidAllowWhileIdle' is deprecated #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mohamadtout opened this issue Oct 8, 2023 · 0 comments
Open

'androidAllowWhileIdle' is deprecated #4

mohamadtout opened this issue Oct 8, 2023 · 0 comments

Comments

@mohamadtout
Copy link

'androidAllowWhileIdle' is deprecated and shouldn't be used. Deprecated in favor of the androidScheduleMode parameter.
Try replacing the use of the deprecated member with the replacement.

For androidScheduleMode there is 5 possible values, shown below from the official file

enum AndroidScheduleMode {
  /// Used to specify that the notification should be scheduled to be shown at
  /// the exact time specified AND will execute whilst device is in
  /// low-power idle mode. Requires SCHEDULE_EXACT_ALARM permission.
  alarmClock,

  /// Used to specify that the notification should be scheduled to be shown at
  /// the exact time specified but may not execute whilst device is in
  /// low-power idle mode.
  exact,

  /// Used to specify that the notification should be scheduled to be shown at
  /// the exact time specified and will execute whilst device is in
  /// low-power idle mode.
  exactAllowWhileIdle,

  /// Used to specify that the notification should be scheduled to be shown at
  /// at roughly specified time but may not execute whilst device is in
  /// low-power idle mode.
  inexact,

  /// Used to specify that the notification should be scheduled to be shown at
  /// at roughly specified time and will execute whilst device is in
  /// low-power idle mode.
  inexactAllowWhileIdle,
}

In my use_case, i found replacing androidAllowWhileIdle: true, with androidScheduleMode: AndroidScheduleMode.exactAllowWhileIdle, to be the ideal switch but your mileage might vary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant