Pigeon v1.0.3 Pigeon.FCM.Notification
Defines FCM notification struct and convenience constructor functions.
Summary
Functions
Creates FCM.Notification
struct with device registration IDs and optional
notification and data payloads
Updates "data"
key in push payload
Updates "notification"
key in push payload
Types
Functions
Creates FCM.Notification
struct with device registration IDs and optional
notification and data payloads.
Examples
iex> Pigeon.FCM.Notification.new("reg ID")
%Pigeon.FCM.Notification{
payload: %{},
registration_id: "reg ID",
priority: :normal
}
iex> Pigeon.FCM.Notification.new("reg ID", %{"body" => "test message"})
%Pigeon.FCM.Notification{
payload: %{"notification" => %{"body" => "test message"}},
registration_id: "reg ID",
priority: :normal
}
iex> Pigeon.FCM.Notification.new("reg ID", %{"body" => "test message"}, %{"key" => "value"})
%Pigeon.FCM.Notification{
payload: %{
"data" => %{"key" => "value"},
"notification" => %{"body" => "test message"}
},
registration_id: "reg ID",
priority: :normal
}
Updates "data"
key in push payload.
Examples
iex> Pigeon.FCM.Notification.put_data(%Pigeon.FCM.Notification{}, %{"key" => 1234})
%Pigeon.FCM.Notification{
payload: %{"data" => %{"key" => 1234}},
registration_id: nil
}