Skip to content

'androidAllowWhileIdle' is deprecated #4

Open
@mohamadtout

Description

@mohamadtout

'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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions