Open lgastler opened 1 year ago
The struct
function can handle this for you.
msg = %{
"timestamp" => System.system_time(:second),
"event" => "update",
"content-state" => %{
"value" => 7
}
notf = Pigeon.APNS.Notification.new(msg, device_token, topic) |> struct(push_type: "liveactivity")
Is your feature request related to a problem? Please describe. When updating iOS LiveActivities via Push (docs) the
push_type
needs to beliveactivity
. As far as I found, changing thepush_type
is only possible by creatingPigeon.APNS.Notification
from scratch.Like this (valid example for liveactivities):
Describe the solution you'd like Creating the struct from scratch is not really a problem, but it would be nice to change that f.e. using a utility function. This is not only helpful for liveactivities but different types of push below a list of valid
push_type
s values for APNS (see docs)alert
background
location
voip
complication
fileprovider
mdm
liveactivity
pushtotalk