Skip to content

Commit

Permalink
added set apns
Browse files Browse the repository at this point in the history
  • Loading branch information
grahac committed Sep 24, 2024
1 parent 53f87c1 commit e50df73
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/pigeon/fcm/notification.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e50df73

Please sign in to comment.