Web Push Notification

AoleeAolee Hobbyist & Coder ✭✭

Hi all,

Just wondering if anyone has started working on WEB Push notification (FCM)? This is could be a good feature to re-engage back the members to the forum. I understand web push notification allows redirection to a url upon clicking the notification. Users can be easily be re-directed to a discussion or even a private message with the right url path. I understand Web Push Notification doesn't work with iOS Safari, which made me think also of a simple app that only allows users to login (so that app can generate the Registration token and send back to server) , then sends a push notification via mobile push (FCM).

Comments

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    I have thought about that. FCM and Web Push Notifications are two different things by the way. There APP based pushed notifications and that is where FCM comes from and there is the WEB push notification (API) which allows web sites to send users push messages over the browser.

    You can either implement push notifications by yourself or use a service like SendPulse that has a great free plan which allows you to send unlimited push noifications to a maximum of 10k subscribers for free.

    "Push notifications" simply are a technology. You need to know what you want to send to your users. And when thinking about that, you will soon have to think about how the sending should be initiated which will lead to the problem of scalability: if you send notifications on every event that normally triggers a Vanilla notification, you will have the problem that the user who starts such a process by creating content will face a huge delay.

    You will need a task queue that does all the sendings. I hope that this is comming soon!

    So you will need to implement the following:

    • either a third party service or web workers
    • if you decide to implement the web workers, you need to take care for the subscriptions, otherwise you can rely on the third party JS
    • a message queue that sends notifications
    • the notification setting in the profile section
    • the notification sending process itself
    • a way to allow unsubscriptions

    That's quite a complex task I'd say.

    But if you ask me, that is a feature a forum in 2019 should offer. I hope it is on the road map of Vanills Inc.


  • AoleeAolee Hobbyist & Coder ✭✭

    @R_J thanks for the great insight, actually I just completed a POC (proof of concept). I managed to create a simple plugin that sends a web push notification on chrome mobile / desktop via Firebase when a user replies to a discussion - it sends notification to other members in that discussion. still need a lot of refinement and improvement (especially on the message queue you have mentioned).

    Yes you are right about message queue, I thought about that problem too, imagine if you have a discussion with a great number of participants . It will be quite slow to send to all participants upon comment submit. right now my plugin sends notification upon comment submit, it works well bec i only 2 test device (other test participants) with token registered but scary on prod.

    Btw I was thinking of using OneSignal as push service but skeptical about their free 30k active limit a month, as I understand active means number of active registered tokens, if my user has a mobile chrome and web chrome it will be 2 different device count right away. my token registration is 1 user is to many device.

    For the mobile app, It just thought it will be good to have, as a fall back for notification on ios. (still yet to be developed) - probably just a login page and it registers the token upon login.

    Another thing I'm thinking is Phase 2... to complete the package with a nodejs to real time update a thread or group conversation (so it will really look like a chat group)

    ill upload the plugin once it's more production ready :) might take some time so please bear with me.

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    I would recommend not to use Firebase. It binds you to Android (even worse to one company: Google), whereas web push API is a standard that hopefully even Safari might support at some time in the future.

    Here are two links for push notifications without Google:



Sign In or Register to comment.