This is not easy, because the payload must be encrypted.
If you are just interested in checking out the functionality, I recommend trying this page . In the end, if you follow the steps, it prints a curl
command to send a notification.
If you want to know more about how to encrypt a payload, click here .
If you want to use the Node.js library, which hides the complexity of sending the payload, there is a web push library .
Assuming that:
p256dh key = BPdbyNlxaH6zreGrZfHWtct8xVR9g1LjOagGsdyxllxT-BsWC5zFBlp4AsD4uXZ3kAA6zfqQPLoLxEklSI2muoU
salt = FD9bsatP7pGf6qeO_XVu_Q
local key = BMGAejiMWatMYFfEdV-YIZpbMeW9N41tav6DW_S7eNRP6In9wwKs-XpKGGkxZUI3-bPti5HBBLY1E8uVRlsF6FE
Command example:
echo -ne "\x12\xdb\xd8\xc5\xcc\x92\x0f\xf2\xa5\x9d\x8c\xca\xea\x58\x13\xf6\xbd\x9a\x14\xa5\xca\x6f\xa0\xb3\x6c\x73\x32\x4a\x4e\x03\x55\x8c\x11\x62\x45\x8d" > encrypted.data; curl -v -X POST https://updates.push.services.mozilla.com/push/v1/SUBSCRIPTION_ID_HERE -H "encryption-key: keyid=p256dh;dh=BMGAejiMWatMYFfEdV-YIZpbMeW9N41tav6DW_S7eNRP6In9wwKs-XpKGGkxZUI3-bPti5HBBLY1E8uVRlsF6FE" -H "encryption: keyid=p256dh;salt=FD9bsatP7pGf6qeO_XVu_Q" -H "content-encoding: aesgcm128" -H "TTL: 60" --data-binary @encrypted.data
Marco source share