Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop notifications #155

Closed
TheJaredWilcurt opened this issue Dec 12, 2019 · 6 comments
Closed

Desktop notifications #155

TheJaredWilcurt opened this issue Dec 12, 2019 · 6 comments
Assignees

Comments

@TheJaredWilcurt
Copy link

Describe the solution you'd like

An easy API to interact with whatever the current OS's desktop notifications system is.

Describe alternatives you've considered

Manually launching a new window disguised to look like a desktop notification (not worth the effort)

@nklayman
Copy link
Member

Would we want to "polyfill" the web notification api so that notifications work the same as in a browser?

@nothingismagick
Copy link
Member

We didn't have this on our roadmap, but I like @nklayman 's idea for polyfilling. Nice one.

@nothingismagick
Copy link
Member

Seems like this would be a good library to use for that (behind a feature flag of course):
https://docs.rs/notify/5.0.0-pre.1/notify/

I think the right approach would be to make a tauri API that hooks into this feature that can then be called from JS or from RS

@nothingismagick
Copy link
Member

here's the branch where this is happening:
https://github.com/tauri-apps/tauri/tree/feature/notification

@nothingismagick
Copy link
Member

And here's the PR
#505

@lucasfernog
Copy link
Member

Closed by #505
The notifications API is going to be accessible with the Notification WEB API. Currently we'll support title, body and icon.

Example:

Notification.requestPermission()
  .then(response => {
    if (response === 'granted') {
      new Notification('title', { body: 'some text' })
    }
  })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants