Skip to content

Commit

Permalink
chore: update firebase sw
Browse files Browse the repository at this point in the history
  • Loading branch information
enesozturk committed Jan 12, 2024
1 parent 6c9a12e commit a9a071d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/firebase-messaging-sw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,11 @@ onBackgroundMessage(messaging, async ev => {
body: m.body
})
})

self.addEventListener('notificationclick', function (event) {
console.log('>>> SW: notificationclick', event)
var urlToRedirect = event.notification.data.url || 'https://app.web3inbox.com'

event.notification.close()
event.waitUntil(self.clients.openWindow(urlToRedirect))
})

0 comments on commit a9a071d

Please sign in to comment.