Push notifications using Elixir Channels?

You would have to write a transport [0] (or something like that) for push notifications, probably (which are usually http/2 now) since they are different from websockets and long poll with which channels work right now.

It would be easier to just use one of the libraries made exactly for push notifications [1][2][3] and call their functions from within your channels.

You might also want to consider using something like a queue or a genstage [4].

[0] https://hexdocs.pm/phoenix/Phoenix.Socket.Transport.html
[1] https://github.com/inaka/apns4erl – ios only (supports http/2)
[2] https://github.com/codedge-llc/pigeon – ios and andriod (supports http/2)
[3] https://github.com/chvanikoff/apns4ex – ios only (http/1.1 only?)
[4] https://blog.discordapp.com/how-discord-handles-push-request-bursts-of-over-a-million-per-minute-with-elixirs-genstage-8f899f0221b4

2 Likes