Search code examples
push-notificationgoogle-cloud-messagingweb-pushchrome-gcmweb-notifications

How to display push notifications from my website?


I'm developing a simple website and I want my website to display push notifications to my users. It is something similar to how facebook.com displays notifications in chrome and firefox. I'm also working on an Android app that also supports push notifications through GCM.

So I need help on how to add push notification support to my website. Thanks in advance!


Solution

  • You can use Service Workers in order to display notifications from a website as stated in Implementing GCM Client on Chrome. You can refer to push messaging codelab on how to implement it.