[Seaside] Push notification
Cyril Ferlicot D.
cyril.ferlicot at gmail.com
Fri Sep 22 18:58:11 UTC 2017
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 at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
--
Cyril Ferlicot
https://ferlicot.fr
http://www.synectique.eu
2 rue Jacques Prévert 01,
59650 Villeneuve d'ascq France
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20170922/35c55ca8/attachment.sig>
More information about the seaside
mailing list