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
|
|
|
|
|
|
|
def push(%{firebase_token: token}, message) do
|
|
|
|
IO.puts "Pushing #{message} to #{token}"
|
|
|
|
n = Pigeon.FCM.Notification.new({:token, token}, %{"body" => message})
|
2021-12-30 13:06:26 +01:00
|
|
|
Bump.FCM.push(n)
|
|
|
|
%{status: 'cheese'}
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|