简体   繁体   中英

Rails Twilio callback event listener

In Twilio, once you send a text message, it fires a few POST requests to the statusCallbackUrl. How do I listen for this callback in my angular/rails app? I see the posts being made in the console. I would simply like to just trigger a notification alert( without refreshing the page preferably) once a post request has been made by twilio. Any suggestions on this?

Twilio developer evangelist here.

I would recommend looking into Server Sent Events (SSE) and ActionController::Live::SSE .

SSE are a way of sending data from a server to your front end. The data is then received in your front end JavaScript and you can update your view that way without reloading the page.

There are some good blog posts that show how to use SSE with Rails, take a look at:

Let me know if that helps at all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM