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

Best practices to dismiss web push notifications cross devices #359

Open
Maxou44 opened this issue May 19, 2023 · 0 comments
Open

Best practices to dismiss web push notifications cross devices #359

Maxou44 opened this issue May 19, 2023 · 0 comments

Comments

@Maxou44
Copy link

Maxou44 commented May 19, 2023

Hello,

I'm working on a web application that allows receiving push notifications on different devices. I would like to ensure that when a user reads a notification on one device, it gets removed from the others.

I wanted to use subscribe with userVisibleOnly: false, but it seems that Chrome doesn't currently support it...

It seems that if no notification is sent for a "push" event at the service worker level, the browser may display a warning notification to the user indicating that it's working in the background.

I was thinking of including the IDs of my unread notifications in each push and removing any notifications that don't match before adding the new one. However, I'm still facing an issue if I have only one notification and it becomes read.

What are the current best practices to achieve this?

Have a good day.
Maxime

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

1 participant