capacitor-plugins icon indicating copy to clipboard operation
capacitor-plugins copied to clipboard

feat: Add Android chronometer support to local notifications plugin

Open danielkleebinder opened this issue 4 months ago • 0 comments

Feature Request

Plugin

  • @capacitor/local-notifications

Description

Sometimes it is important for time related tasks to show a timer inside the notification. Android supports such functionality by calling the setUsesChronometer function on the Notification.Builder class. Setting this parameter to true will add a small timer with the format "HH:mm" that is counting the duration the notification is active.

The Cordova Plugin / Local Notification supports this as androidUsesChronometer and androidShowWhen properties. Adding this feature would make migration to the capacitor plugin even more straight forward.

Platform(s)

  • Android

Preferred Solution

Add a parameter called usesChronometer to the LocalNotificationSchema of the @capacitor/local-notifications Plugin. Here is an example, of how this configuration might look like:

LocalNotifications.schedule({
  notifications: [
    {
      id: 283912,
      title: 'Test Notification',
      usesChronometer: true
    }
  ]
});

Alternatives

No alternatives that come in mind.

Additional Context

I need this feature for one of my apps. It is important for the user to see how long the notification is already active.

danielkleebinder avatar Sep 28 '25 11:09 danielkleebinder