diff --git a/lib/who_need_help/push/fcm_adapter.ex b/lib/who_need_help/push/fcm_adapter.ex index 1ff5051..ff50af5 100644 --- a/lib/who_need_help/push/fcm_adapter.ex +++ b/lib/who_need_help/push/fcm_adapter.ex @@ -40,7 +40,7 @@ defmodule WhoNeedHelp.Push.FCMAdapter do def payload(%Notification{} = notification, %PushDevice{} = device) do %{ "message" => %{ - "token" => device.token, + "fid" => device.token, "data" => notification.data |> stringify_values() diff --git a/test/who_need_help/push_product_test.exs b/test/who_need_help/push_product_test.exs index 8c2d0db..c761fb7 100644 --- a/test/who_need_help/push_product_test.exs +++ b/test/who_need_help/push_product_test.exs @@ -236,7 +236,8 @@ defmodule WhoNeedHelp.PushProductTest do message = payload["message"] refute Map.has_key?(message, "notification") - assert message["token"] == "firebase-installation-id" + refute Map.has_key?(message, "token") + assert message["fid"] == "firebase-installation-id" assert message["data"]["title"] == "New message" assert message["data"]["body"] == "Open Who Need Help to read the conversation." assert message["data"]["path"] == notification.path