Open shahryarjb opened 2 years ago
the elixir library (https://github.com/danhper/elixir-web-push-encryption) works great - and present day webpush is a totally different from the classic app push services that pigeon support.
namely you do individual POST per browser push subscription:
...
msg = %{
title: "Chat: #{user.first_name} #{user.sur_name}",
body: "#{message_text}",
openUrl: "/chat?topic=#{message.room_id}"
}
browsers
|> Enum.each(fn browser ->
subscription = %{
keys: %{
p256dh: browser.p256dh,
auth: browser.auth
},
endpoint: browser.endpoint
}
{:ok, response} = WebPushEncryption.send_web_push(Jason.encode!(msg), subscription)
...
which is totally different from what Pigeon does (maintain a http2 connection/stream to the push servers)..
so with all respect I see little reason for Pigeon to support webpush - especially as there already is a well functioning elixir library..
Request for feature. 🌹
Hi, I created a post in elixir forum https://elixirforum.com/t/how-to-send-push-notification-with-pigeon-when-we-have-subscriptions/50934
So I asked about Web Push Payload Encryption
When we have a subscription like
which is created by this code in service worker (
sw.js
) file:I think your library does not support it, I could not be able to find any document. I work with https://www.npmjs.com/package/web-push in JavaScript and recently found a library https://github.com/danhper/elixir-web-push-encryption in elixir to support it.
If it is possible, support this Feature
Thank you in advance for all your efforts.