Ask A Question

Notifications

You’re not receiving notifications from this thread.

What's the best way to implement Web Push Notification with Rails API?

norman santiago asked in Rails

I have been looking on how I'm going to add a feature of Web Push Notification on our School Project currently and found some services like Twilio, Pushbots and OneSignal. Though even trying those 3 I noticed a long delay or sometimes I don't even receive the notifications.

Is their a better way to send a notification to a user in more near realtime even if the site is not opened? I saw there's a Screencast on Real Time Notification but as far as I'm aware if I close the site then the user won't be able to receive the notification. Please correct me if I'm wrong on that part. Thanks

Reply

There are lots of different types of notifications. A browser Notification in Javascript requires the user to be on the page. Email notification does not of course. Mobile typically requires a mobile app is installed and registered for notifications.

I'm fairly sure that mobile browser web push notifications in Javascript don't go through when the user is off the page. You'll probably need to do some research on that.

You can always send SMS or Slack notifications so the user would receive the messages through another form.

Reply

Thanks Chris, it seems SMS is the only option for me since I want my user to be notified even if they're off the page. Luckliy for me you have one screencast featuring Twilio SMS.

Reply

Twilio is a lot of fun. 🤓

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 84,387+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.