2021-12-30 13:06:26 +01:00
|
|
|
defmodule Bump.Firebase do
|
|
|
|
|
|
|
|
def test() do
|
|
|
|
IO.puts "Hello, world!"
|
|
|
|
end
|
|
|
|
|
2021-12-30 16:23:54 +01:00
|
|
|
|
2022-01-03 13:07:33 +01:00
|
|
|
def push(%{"firebase_token" => token, "title" => title, "data" => data}) do
|
|
|
|
IO.puts "Pushing #{title}"
|
|
|
|
n = Pigeon.FCM.Notification.new(
|
|
|
|
{:token, token},
|
|
|
|
%{"body" => title},
|
|
|
|
%{"data" => data})
|
2021-12-30 13:06:26 +01:00
|
|
|
Bump.FCM.push(n)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|