@@ -22,16 +22,18 @@ type aps struct {
2222}
2323
2424type alert struct {
25- Action string `json:"action,omitempty"`
26- ActionLocKey string `json:"action-loc-key,omitempty"`
27- Body string `json:"body,omitempty"`
28- LaunchImage string `json:"launch-image,omitempty"`
29- LocArgs []string `json:"loc-args,omitempty"`
30- LocKey string `json:"loc-key,omitempty"`
31- Title string `json:"title,omitempty"`
32- Subtitle string `json:"subtitle,omitempty"`
33- TitleLocArgs []string `json:"title-loc-args,omitempty"`
34- TitleLocKey string `json:"title-loc-key,omitempty"`
25+ Action string `json:"action,omitempty"`
26+ ActionLocKey string `json:"action-loc-key,omitempty"`
27+ Body string `json:"body,omitempty"`
28+ LaunchImage string `json:"launch-image,omitempty"`
29+ LocArgs []string `json:"loc-args,omitempty"`
30+ LocKey string `json:"loc-key,omitempty"`
31+ Title string `json:"title,omitempty"`
32+ Subtitle string `json:"subtitle,omitempty"`
33+ TitleLocArgs []string `json:"title-loc-args,omitempty"`
34+ TitleLocKey string `json:"title-loc-key,omitempty"`
35+ SummaryArg string `json:"summary-arg,omitempty"`
36+ SummaryArgCount int `json:"summary-arg-count,omitempty"`
3537}
3638
3739type sound struct {
@@ -235,6 +237,28 @@ func (p *Payload) AlertActionLocKey(key string) *Payload {
235237 return p
236238}
237239
240+ // SummaryArg sets the aps alert summary arg key on the payload.
241+ // This is the string that is used as a key to fill in an argument
242+ // at the bottom of a notification to provide more context, such as
243+ // a name associated with the sender of the notification.
244+ //
245+ // {"aps":{"alert":{"summary-arg":key}}}
246+ func (p * Payload ) AlertSummaryArg (key string ) * Payload {
247+ p .aps ().alert ().SummaryArg = key
248+ return p
249+ }
250+
251+ // SummaryArgCount sets the aps alert summary arg count key on the payload.
252+ // This integer sets a custom "weight" on the notification, effectively
253+ // allowing a notification to be viewed internally as two. For example if
254+ // a notification encompasses 3 messages, you can set it to 3.
255+ //
256+ // {"aps":{"alert":{"summary-arg-count":key}}}
257+ func (p * Payload ) AlertSummaryArgCount (key int ) * Payload {
258+ p .aps ().alert ().SummaryArgCount = key
259+ return p
260+ }
261+
238262// General
239263
240264// Category sets the aps category on the payload.
0 commit comments