Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions messaging/messaging.go
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,10 @@ type WebpushFCMOptions struct {
// See https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html
// for more details on supported headers and payload keys.
type APNSConfig struct {
Headers map[string]string `json:"headers,omitempty"`
Payload *APNSPayload `json:"payload,omitempty"`
FCMOptions *APNSFCMOptions `json:"fcm_options,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Payload *APNSPayload `json:"payload,omitempty"`
FCMOptions *APNSFCMOptions `json:"fcm_options,omitempty"`
LiveActivityToken string `json:"live_activity_token,omitempty"`
}

// APNSPayload is the payload that can be included in an APNS message.
Expand Down
15 changes: 15 additions & 0 deletions messaging/messaging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,21 @@ var validMessages = []struct {
"topic": "test-topic",
},
},
{
name: "APNSLiveActivity",
req: &Message{
Token: "test-token",
APNS: &APNSConfig{
LiveActivityToken: "live-activity-token",
},
},
want: map[string]interface{}{
"token": "test-token",
"apns": map[string]interface{}{
"live_activity_token": "live-activity-token",
},
},
},
{
name: "AndroidNotificationPriorityMin",
req: &Message{
Expand Down
Loading