#Using Tauri's Notification API with tokio::spawn()

3 messages · Page 1 of 1 (latest)

daring obsidian
#

Hey all! So I have a notification module in my Tauri app that implements Tauri's Notification API (see https://docs.rs/tauri/latest/tauri/api/notification/struct.Notification.html#impl-Sync-for-Notification) and provides an easy way for the app to prompt notifications on certain events of my choosing. All I have to do is call my created notify(title, message) method it works like a charm EXCEPT for when I try to use it inside a tokio::spawn() block. I need to notify when a process from a separate thread inside this spawn() block is finished but the notification simply won't pop up. Is there a requirement for the notification API to be running on the main thread for it to work? Is there a viable workaround? I can't block the main thread and wait for the spawn() process to finish up before notifying. Any ideas? Appreciate the help!

proven carbon
#

Which OS are you on?

#

also, i think a github issue would be more appropiate, looks like something we should handle in tauri.