Re: Push notification

"Cyril Ferlicot D." <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <[email protected]>
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
> [email protected]
> 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

_______________________________________________
seaside mailing list
[email protected]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJZxV1RAAoJEBzpUtxBqUIDiz8P/j4mQt4lc7ahkQl1L2mdykz2
j/4WnWBfwIfFp8MY+lh8DIwbkOO3+g/sNG7JHmXV+7b+fb9uarPYQN+EnlAjD+zx
78wekzA8/QIYR9kGFgBLq2rddEfD92sk19GPutb1pFq5xqJVXXnQp3/0j/4wBR4b
IP/1tbIculCeWqrjAdco++TwuDZhd71ImEDFc4bGUCq20n0oEi824dnVi0ZlpUI0
1ZjUrqUzIJfL+DiRlHPYy1CaiTjsTkUDko1qjOO6lBdg3ZtApck8q1TEPTwrBbab
jbkGQsZVkN9BZarQ2pUDzLmZB+1BZkjjTrRdymqa/NFDsuo3GIXpn158pWurW8q8
L35TDYAkLbKwRTP4AtutUo6XBKg7Mi6ALW5fKy99qQkkzvVJWYY2mzb8+WLDeXcu
p6Yy8VcHDLw0J6D9j5kN/oMyt2nSng/fEHtpdjfFrKbaB4s4RwX0kE+M5j41ATxb
/KatiVzrk+3cRfWizIMDdqtHlL7dEB2BBiAYhjP6T9DwPlZenW+NZOsjVK/OZzMd
2QE2k83E54AJK+upOkKP5byt/tgiDyXNWDt1UG4RNPoaxA9eSSzIol5jotAC0BAg
Z9Ya3YdDIc3GJEfQyvx1TVoN/vAvdwSI0uIss4r2Iha3T33jw2IYXSQGkpi70pM1
Z5OnRASioBOvdQa1LmNL
=SZRv
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.