I am trying to create web notifications like those used by facebook when we receive a message, and create the notification, but how can I send it every time I detect a new record in my database?
my notification is the following
<script src="https://pushjs.org/scripts/push.min.js" ></script>
<script>
Push.create("Tienes un nuevo ticket", {
body: "$funcionario tiene una incidendi",
icon: '/icon.png',
timeout: 4000,
onClick: function () {
window.focus();
this.close();
}
});
</script>