Skip to content

feat: ignore older LocalNotifications on reschedule #435

Open
@MedaiP90

Description

@MedaiP90

Feature Request

Description

Because of the rescheduling mechanism on the Android platform at device reboot or startup, it will be usefull expose a property for LocalNotifications that allows to delete (without showing) notifications older than a certain amount of time instead of presenting or rescheduling them at startup. For example, LocalNotifications generated by some sort of calendar app for an event on a certain date should not be presented if the date (at reboot/startup time) is in the past.

Platform(s)

Android

Preferred Solution

Expose some property in the LocalNotification object named "ignoreIfOlderThan", it will be an object containing a numeric value and a time unit type:

const localNotification: LocalNotification = {
    id: ID,
    title: SOME_TITLE,
    body: SOME_BODY,
    sound: 'default',
    schedule: {
        at: SOME_DATE,
    },
    ignoreIfOlderThan: {
        value: 1,
        unit: "day"     // or "month", "hour", "second"...
    }
}

In this case the BroadcastReceiver for startup event will check if notifications saved in LocalNotificationStorage are scheduled for the previous day and it will remove every metch.

Additional Context

  • Schedule a banch of LocalNotifications
  • Shutdown the Android device
  • Power on the device after some LocalNotification schedule date/time is passed
  • The notification should be deleted from the notification storage because is no longer valid and not presented or rescheduled

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions