How can I use Firebase to send push notifications to a website


(Karthik Kamalakannan) #1

I am planning to go completely server less for my website, but would like to retain the push notifications feature for my blog. Is there a possibility to use Firebase’s JavaScript API to send desktop push notifications to my users?

Can you please point me out to such resources online or help me out here?

(Varun Raj) #2

You can definitely do that with help of service workers.

With service workers you can run a piece of Javascript code even when the site is not opened in the browser. Add the firebase listener for FCM and create desktop notification when there is a new push from FCM.

(Karthik Kamalakannan) #3

Great. Thanks for this @varun.

We will still need Chrome or Firefox to make this happen right?