web_push_encryption v0.1.0 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

send_web_push(message, subscription, auth_token)

Specs

send_web_push(message :: binary, subscription :: map, auth_token :: binary) ::
  {:ok, any} |
  {:error, atom}

Sends a web push notification with a payload through GCM.

Arguments

  • message is a binary payload. It can be JSON encoded
  • subscription is the subscription information received from the client. It should have the following form: %{keys: %{auth: AUTH, p256dh: P256DH}, endpoint: ENDPOIONT}
  • auth_token is the GCM api key matching the gcm_sender_id from the client manifest.json

Return value

Returns the result of HTTPoison.post