From e50df7391c7498cbc816962ba54ef5ece250e2ce Mon Sep 17 00:00:00 2001 From: grahac Date: Tue, 24 Sep 2024 10:50:54 -0700 Subject: [PATCH] added set apns --- lib/pigeon/fcm/notification.ex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/pigeon/fcm/notification.ex b/lib/pigeon/fcm/notification.ex index 24dd5f81..8d4b6fa3 100644 --- a/lib/pigeon/fcm/notification.ex +++ b/lib/pigeon/fcm/notification.ex @@ -46,9 +46,9 @@ defmodule Pigeon.FCM.Notification do FCM notification target. Must be one of the following: - `{:token, "string"}` - Registration token to send a message to. - - `{:topic, "string"}` - Topic name to send a message to, e.g. "weather". + - `{:topic, "string"}` - Topic name to send a message to, e.g. "weather". Note: "/topics/" prefix should not be provided. - - `{:condition, "string"}` - Condition to send a message to, e.g. "'foo' + - `{:condition, "string"}` - Condition to send a message to, e.g. "'foo' in topics && 'bar' in topics". """ @type target :: {:token, binary} | {:topic, binary} | {:condition, binary} @@ -100,6 +100,10 @@ defmodule Pigeon.FCM.Notification do end end +def set_apns(%Pigeon.FCM.Notification{} = notification, apns) do + %{notification | apns: apns} +end + defimpl Pigeon.Encodable, for: Pigeon.FCM.Notification do def binary_payload(notif) do encode_requests(notif)