How to handle push notification when site is already open?

Viewed 108

I am making a site in JavaScript. It uses Firebase push-notifications. I get notifications when the site is closed, or it's on a different tab. However, I want to receive notifications even if the site is already open, or do something when it receives a notification. How can I do that?

1 Answers

If you are deploying your application using GCP, you need to change edit your firebase-messaging-sw.js using editor.

Here is a lab that could help you; this information could help you

Related