Hello all,I'm reading about browser push notification.The API looks simple enough, and it may be a good fit for our application. Has anyone explored this with Seaside? Web Notifications
| | | | | |
|
| | | | Web Notifications | |
|
|
Thanks,Bob Nemec
Le 15/09/2017 à 20:23, Bob Nemec a écrit :
Hello all, I'm reading about browser push notification. The API looks simple enough, and it may be a good fit for our application. Has anyone explored this with Seaside?
Web Notifications https://www.w3.org/TR/notifications/
Hi,
My company use it but we use pure javascript for now and we did not get the time to bind it to Seaside.
Here is an example:
'function fallback(){ /* fallback function to notify the user in case web notif is not accepted by the user */ }
if(!("Notification" in window)){ fallback(); // User does not accept notifications } else if(Notification.permission === "granted"){ new Notification("Message to show"); } else if(Notification.permission !== "denied"){ Notification.requestPermission(function(permission){ if (permission === "granted"){ new Notification("Message to show"); }else{ fallback(); // The user did not accept } }); } else { fallback(); };'
I don't know if this code work for sure but it should be close to something like this.
Web Notifications
https://www.w3.org/TR/notifications/
Thanks, Bob Nemec
seaside mailing list seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
seaside@lists.squeakfoundation.org