web_push_encryption v0.1.2 WebPushEncryption.Push
Module to send web push notifications with a payload through GCM
Summary
Functions
Sends a web push notification with a payload through GCM
Functions
Specs
send_web_push(message :: binary, subscription :: map, auth_token :: binary | nil) ::
{:ok, any} |
{:error, atom}
Sends a web push notification with a payload through GCM.
Arguments
messageis a binary payload. It can be JSON encodedsubscriptionis the subscription information received from the client. It should have the following form:%{keys: %{auth: AUTH, p256dh: P256DH}, endpoint: ENDPOIONT}auth_token[Optional] is the GCM api key matching thegcm_sender_idfrom the clientmanifest.json. It is not necessary for mozzilla endpoints.
Return value
Returns the result of HTTPoison.post