Hello. There are browser notifications. How to send this notification to a specific user (specific browser)? (all users are allowed to display alerts and all users have a function that is listed below. It is for example) In the online store, the user did not order the product and the administrator wants to send him a browser notification (only to him).

function notifyMe() { if (!("Notification" in window)) { alert("This browser does not support desktop notification"); } else if (Notification.permission === "granted") { var notification = new Notification("Hi there!"); } else if (Notification.permission !== 'denied') { Notification.requestPermission(function (permission) { if (permission === "granted") { var notification = new Notification("Hi there!"); } }); } } 

    1 answer 1

    Come up with a solution. All put on the channels (using sockets) and via php send to a specific channel information about what you need to show the notification. And on js you need to run the function with certain parameters.