I'm having some trouble implementing Push notifications in a Quasar PWA. From what I've found on stackoverflow is that the notification needs to be executed immediately before any other code. Using the template given by the repos README.md is am running into the problem. However debugging the chrome dev tools the push notification comes in with the correct payload. But the notification shows: The site has been updated in the background without the provided notification settings I've given. It's pretty difficult to understand what's going wrong.
Is there any code executed before the ready function?
What's the best way to debug this?
my ready function:
async ready() {
self.addEventListener('push', function (e) {
e.waitUntil(
self.registration.showNotification('Test notification', body: 'Testing the push notification' })
)
})
console.log('App is being served from cache by a service worker.')
const permission = await Notification.requestPermission()
if (permission === 'granted') {
console.log('Agora você receberá notificações importantes.')
} else {
console.log('Notificações negada.')
}
},
I'm having some trouble implementing Push notifications in a Quasar PWA. From what I've found on stackoverflow is that the notification needs to be executed immediately before any other code. Using the template given by the repos
README.md
is am running into the problem. However debugging the chrome dev tools the push notification comes in with the correct payload. But the notification shows:The site has been updated in the background
without the provided notification settings I've given. It's pretty difficult to understand what's going wrong.ready
function?my
ready
function: