1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.Push do
8 alias Pleroma.Web.Push.Impl
17 GenServer.start_link(__MODULE__, :ok, name: __MODULE__)
21 Application.get_env(:web_push_encryption, :vapid_details, [])
25 case vapid_config() do
27 list when is_list(list) -> true
32 def send(notification),
33 do: GenServer.cast(__MODULE__, {:send, notification})
45 VAPID key pair is not found. If you wish to enabled web push, please run
47 mix web_push.gen.keypair
49 and add the resulting output to your configuration file.
57 def handle_cast({:send, notification}, state) do
59 Impl.perform_send(notification)