Push notification

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Push notification

Bob Nemec
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?




Thanks,
Bob Nemec

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Bob Nemec
Reply | Threaded
Open this post in threaded view
|

Re: Push notification

CyrilFerlicot
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
> [hidden email]
> 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
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Push notification

Bob Nemec
Thanks... 

I also have the pure Javascript implementation working. I'll take a look at how I could use AppeX.

Bob 


On Friday, September 22, 2017 3:15 PM, Jerry Kott <[hidden email]> wrote:


Bob,

you might want to try integrating an AppeX client into the Seaside application. AppeX has server push API for both EventStream and WebSocket JavaScript APIs, and VW also has an example on how to integrate AppeX and Seaside in a single solution. Here are some hints on where to find what might be helpful:

AppeX-Client parcel, ApplicationClient.onServerEvent() JS method
AppeX-Server parcel, ServerEvent class
AppeX-Examples-Seaside parcel

Jerry Kott, OSCP
Senior Software Engineer


Cincom Systems
55 Merchant Street
Cincinnati, OH 45246

office

website

513-612-2003

www.cincomsmalltalk.com

This message has been digitally signed. PGP Fingerprint: 07D0987E142BE7D39A3F99D71DAF1CF392A9236F

> On 22-09-2017, at 11:58 AM, Cyril Ferlicot D. <[hidden email]> wrote:
>
> 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
>> [hidden email]
>> 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
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Bob Nemec