PWA Push notifications while app is open

0
HI, I have succeeded in getting push notifications working in my PWA app. As MxAdmin, I can trigger a message to be sent to a device which registered to receive notifications. However, it only works when the app is closed. I believe this is expected, but I would also like notifications to be delivered when the app is open. I have read about installing a listener (AppEvents widget) but this is only for Native.  There is a listener widget called Events but it doesn't have the option to name an Action, which is needed to link the trigger to the homepage. And secondly, if I did get that to work, what if we are on a different page to the homepage? Hope you can help. Thanks.  
asked
3 answers
1

Hi Wendy,

Push notifications only works in background.

But when your app is open & you want to get notifications then you have to use toast notifications.

Check out this video

https://youtu.be/O5kSV_JiOTQ?si=SBypcFzNn2aiZhEm

 

answered
0

Hello Wendy, 

 

There are different modules for that or you can create it yourself for example with an websocket :

 

https://marketplace.mendix.com/link/component/107957 - Pusher

https://marketplace.mendix.com/link/component/118651?ste_sid=fe404d26ea7595392c57362e9552ff3f - Toastr

 

Hope this helps,

 

Good luck!

 

answered
0

Hi Jelle van Leeuwen, Thanks for the info. I am investigating the Toastr option.  I like this idea.

 

Many thanks.

Wendy

answered