tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[feat] Scheduled notification

Open BillGoldenWater opened this issue 3 years ago • 1 comments

Describe the problem

A api to schedule(and cancel) a notification for remind user when app is not open without setup a background process.

Describe the solution you'd like

create

use tauri::api::notification::Notification;

Notification::new("ident")
  .title("Tauri")
  .show_after(Duration::from_millis(1))
  
// and

Notification::new("ident")
  .title("Tauri")
  .show_at(chrono::Utc.ymd(2022, 9, 18).and_hms(0,0,0))

cancel

use tauri::api::notification::Notification;

Notification::cancel_scheduled("ident")

Alternatives considered

No response

Additional context

https://developer.apple.com/documentation/usernotifications/scheduling_a_notification_locally_from_your_app https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/scheduled-toast

BillGoldenWater avatar Sep 17 '22 18:09 BillGoldenWater

This needs to be added to upstream first in notify-rust

amrbashir avatar Sep 19 '22 13:09 amrbashir

Since you guys use notify-rust, Look at this:

https://github.com/hoodie/notify-rust/blob/main/examples/schedule.rs

And if you guys are going to upgrade it, please also add actions: support (https://github.com/hoodie/notify-rust/blob/main/examples/actions.rs)

Miniontoby avatar Dec 15 '22 16:12 Miniontoby