Notifications with phoenix

Does anyone know of any documentation to know how notifications are handled in Phoenix?

what kind of notifications?

internal pub/sub?
postgres/db notifications?
ios/android notifications?
browser notifications?

or phoenix β€œflash”

2 Likes

these:

phoenix flash: https://hexdocs.pm/phoenix/search.html?q=flash - first link

browser web push is a bit more complex… look at https://github.com/danhper/elixir-web-push-encryption and the client sample https://github.com/danhper/elixir-web-push-encryption/tree/master/client-sample

Have a look at the default layout file (app.html.eex) located in

lib
β”œβ”€β”€ app_web
β”‚   β”‚   β”œβ”€β”€ layout
β”‚   β”‚   β”‚   └── app.html.eex

you will find a section with the following information.

    <main role="main">
      <p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
      <p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
      <%= render @view_module, @view_template, assigns %>
       .................

the paragraph with the alert tags are what shows the flash messages, you can give it any class that matches the styling you want depending on your CSS

1 Like