@@ -686,13 +686,6 @@ type Aps struct {
686686 MutableContent bool `json:"-"`
687687 Category string `json:"category,omitempty"`
688688 ThreadID string `json:"thread-id,omitempty"`
689- StaleDate * time.Time `json:"-"`
690- ContentState map [string ]interface {} `json:"content-state,omitempty"`
691- Timestamp * time.Time `json:"-"`
692- Event LiveActivityEvent `json:"-"`
693- DismissalDate * time.Time `json:"-"`
694- AttributesType string `json:"attributes-type,omitempty"`
695- Attributes map [string ]interface {} `json:"attributes,omitempty"`
696689 CustomData map [string ]interface {} `json:"-"`
697690}
698691
@@ -724,32 +717,6 @@ func (a *Aps) standardFields() map[string]interface{} {
724717 if a .ThreadID != "" {
725718 m ["thread-id" ] = a .ThreadID
726719 }
727- if a .StaleDate != nil {
728- m ["stale-date" ] = a .StaleDate .Unix ()
729- }
730- if a .ContentState != nil {
731- m ["content-state" ] = a .ContentState
732- }
733- if a .Timestamp != nil {
734- m ["timestamp" ] = a .Timestamp .Unix ()
735- }
736- if a .Event != liveActivityEventUnspecified {
737- events := map [LiveActivityEvent ]string {
738- LiveActivityEventStart : "start" ,
739- LiveActivityEventUpdate : "update" ,
740- LiveActivityEventEnd : "end" ,
741- }
742- m ["event" ] = events [a .Event ]
743- }
744- if a .DismissalDate != nil {
745- m ["dismissal-date" ] = a .DismissalDate .Unix ()
746- }
747- if a .AttributesType != "" {
748- m ["attributes-type" ] = a .AttributesType
749- }
750- if a .Attributes != nil {
751- m ["attributes" ] = a .Attributes
752- }
753720 return m
754721}
755722
@@ -770,10 +737,6 @@ func (a *Aps) UnmarshalJSON(b []byte) error {
770737 SoundObject * json.RawMessage `json:"sound,omitempty"`
771738 ContentAvailableInt int `json:"content-available,omitempty"`
772739 MutableContentInt int `json:"mutable-content,omitempty"`
773- StaleDate * int64 `json:"stale-date,omitempty"`
774- Timestamp * int64 `json:"timestamp,omitempty"`
775- Event string `json:"event,omitempty"`
776- DismissalDate * int64 `json:"dismissal-date,omitempty"`
777740 * apsInternal
778741 }{
779742 apsInternal : (* apsInternal )(a ),
@@ -799,30 +762,6 @@ func (a *Aps) UnmarshalJSON(b []byte) error {
799762 }
800763 }
801764 }
802- if temp .StaleDate != nil {
803- staleDate := time .Unix (* temp .StaleDate , 0 )
804- a .StaleDate = & staleDate
805- }
806- if temp .Timestamp != nil {
807- timestamp := time .Unix (* temp .Timestamp , 0 )
808- a .Timestamp = & timestamp
809- }
810- if temp .Event != "" {
811- events := map [string ]LiveActivityEvent {
812- "start" : LiveActivityEventStart ,
813- "update" : LiveActivityEventUpdate ,
814- "end" : LiveActivityEventEnd ,
815- }
816- if event , ok := events [temp .Event ]; ok {
817- a .Event = event
818- } else {
819- return fmt .Errorf ("unknown event value: %q" , temp .Event )
820- }
821- }
822- if temp .DismissalDate != nil {
823- dismissalDate := time .Unix (* temp .DismissalDate , 0 )
824- a .DismissalDate = & dismissalDate
825- }
826765
827766 allFields := make (map [string ]interface {})
828767 if err := json .Unmarshal (b , & allFields ); err != nil {
@@ -837,22 +776,6 @@ func (a *Aps) UnmarshalJSON(b []byte) error {
837776 return nil
838777}
839778
840- // LiveActivityEvent represents an event type for Live Activity in push notification payloads.
841- type LiveActivityEvent int
842-
843- const (
844- liveActivityEventUnspecified LiveActivityEvent = iota
845-
846- // LiveActivityEventStart starts a Live Activity.
847- LiveActivityEventStart
848-
849- // LiveActivityEventUpdate updates a Live Activity.
850- LiveActivityEventUpdate
851-
852- // LiveActivityEventEnd ends a Live Activity.
853- LiveActivityEventEnd
854- )
855-
856779// CriticalSound is the sound payload that can be included in an Aps.
857780type CriticalSound struct {
858781 Critical bool `json:"-"`
0 commit comments