S
S
StepanZ2019-04-27 15:19:41
Python
StepanZ, 2019-04-27 15:19:41

Why do notifications stop showing in Chrome mobile browser after a certain time?

Worker source:

self.addEventListener('push', event => {
    event.waitUntil(self.registration.showNotification('test', {
        icon: './icon.png',
        body: 'test'
    }))
});

Backend fragment that sends the notification:
webpush(subscription_info=subscription_info, vapid_private_key='./private_key.pem',
                                vapid_claims={'sub': 'sub'},
                                data=data)

The bottom line is that if the phone is used, then notifications come. But let's take a look at another situation. The phone was left alone, 30 minutes pass, the backend sends a notification, but I don’t see it on the phone. Tell me what is the nuance. The worker is not written that way, or maybe I’m using the wrong library on the backend, or maybe it’s not provided for such purposes at all?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question