tauri-apps / tauri-apps/plugins-workspace

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

Open
#3,279 0 comments 0 reactions 0 assignees View on GitHub
platform: android plugin: notification type: feature request
Dominant language
Rust
Stars
1.8k
Forks
602
Avg merge
4d 14h
Merged PRs (30d)
9

Description

### 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.