Skip to content

[feature][notification] Add Android chronometer support in local notifications #3279

@Et3rnel

Description

@Et3rnel

Describe the problem

The notification plugin currently does not expose Android chronometer capabilities, which makes stopwatch/timer UX difficult for mobile apps.

I'm building a time-tracking apps, and I need notifications that can display elapsed (or countdown) time directly in the system notification. Android already supports this through NotificationCompat.Builder chronometer APIs, but tauri-plugin-notification does not currently expose equivalent fields in the JS/Rust API.

Describe the solution you'd like

Add optional Android-focused fields to the notification payload and wire them through all plugin layers (JS guest API, Rust model/builder, Android model/builder):

  • when (epoch ms)
  • usesChronometer (boolean)
  • chronometerCountDown (boolean, Android 24+ behavior)

Expected behavior:

  • On Android, these map to notification builder chronometer APIs so apps can show elapsed/countdown timer notifications.
  • On non-Android platforms, these fields are ignored gracefully.

This would keep backwards compatibility while enabling a common mobile use case.

Alternatives considered

  1. Keep current plugin and implement timer text updates manually by repeatedly sending updated notifications.
    • Works, but less efficient and less native than Android chronometer behavior.
  2. Use platform-specific custom Android code in each app.
    • Works, but defeats plugin portability and increases maintenance burden.

Additional context

I already implemented and validated a local prototype in a fork/local checkout by extending:

  • JS options surface
  • Rust NotificationData and builder
  • Android Notification model and TauriNotificationManager

I plan to open a PR if maintainers agree with this feature direction.

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