O
O
olegxxxl2021-01-19 12:30:21
Laravel
olegxxxl, 2021-01-19 12:30:21

How to implement browser notifications without losing speed?

There is a messenger and a task:
Implement browser notifications. If I am in another tab or minimized the browser (or PWA), so that notifications fly out in the right corner that a new SMS has arrived, if it has arrived ...

Problem:
If you put the push in the queue, then they are sent late, the person already receives and reads the message and then he gets a push like - You have a new message , or even later, while I set a lot of queue handlers, and if this is done in the message sending code, then the response from the server is delayed until all push notifications are sent.

Perhaps there are some examples or options for implementing this task? Maybe someone came across?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sanes, 2021-01-19
@Sanes

Send immediately. And in order not to torment the user with an open tab, focus on Document.onvisibilitychange

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question