Hi, I created a subscription with my service worker and pushManager
in JavaScript side like this:
var vapidPublicKey = 'MY_PUBLIC_KEY';
var convertedVapidPublicKey = urlBase64ToUint8Array(vapidPublicKey);
return reg.pushManager.subscribe({
userVisibleOnly: true,
applicationServerKey: convertedVapidPublicKey,
});
After that, I have something like this in my database:
{
"endpoint": "https://fcm.googleapis.com/fcm/send/USER_STUFF",
"keys": {
"auth": "AUTH_CODE",
"p256dh": "P256DH_CODE"
}
}
So I see the Pigeon support FCM
, but when I want to send a notification as the document says, what is the TOKEN?
n = Pigeon.FCM.Notification.new({:token, "reg ID"}, %{"body" => "test message"})
YourApp.FCM.push(n)
My goal: I am creating a PWA application and I need to send push notification with service worker. It can be Chrome or Firefox, even in desktop or mobile. The user activates and adds the app to their operating system with a manifest
. After that, I should be able to send notifications from the server to the user.
In JavaScript or node server I can send notification with web-push
lib, but in elixir I need to send
Thank you in andvance