Search code examples
angularbrowsernotifications

Angular 15 add browsernotification working on firefox but not on chrome


I am building a application and I want to display a notification when I have new data. This notification (browser):

enter image description here

I dont need any kind of backend service only want to know how I can build this only wth Angular 15.

After asking permission of a user I tried this:

new Notification("To do list", { body: 'Text'})

but nothing happends in Chrome it work fine firefox. Can someone help or explain what I need to do?

Thanks a Lot!


Solution

  • The code I showed was correctly it had to do with secure policies that were added on the browser!