@@ -148,6 +148,7 @@ type Message struct {
148
148
Android * AndroidConfig `json:"android,omitempty"`
149
149
Webpush * WebpushConfig `json:"webpush,omitempty"`
150
150
APNS * APNSConfig `json:"apns,omitempty"`
151
+ FCMOptions * FCMOptions `json:"fcm_options,omitempty"`
151
152
Token string `json:"token,omitempty"`
152
153
Topic string `json:"-"`
153
154
Condition string `json:"condition,omitempty"`
@@ -198,6 +199,7 @@ type AndroidConfig struct {
198
199
RestrictedPackageName string `json:"restricted_package_name,omitempty"`
199
200
Data map [string ]string `json:"data,omitempty"` // if specified, overrides the Data field on Message type
200
201
Notification * AndroidNotification `json:"notification,omitempty"`
202
+ FCMOptions * AndroidFCMOptions `json:"fcm_options,omitempty"`
201
203
}
202
204
203
205
// MarshalJSON marshals an AndroidConfig into JSON (for internal use only).
@@ -274,6 +276,11 @@ type AndroidNotification struct {
274
276
ChannelID string `json:"channel_id,omitempty"`
275
277
}
276
278
279
+ // AndroidFCMOptions contains additional options for features provided by the FCM Android SDK.
280
+ type AndroidFCMOptions struct {
281
+ AnalyticsLabel string `json:"analytics_label,omitempty"`
282
+ }
283
+
277
284
// WebpushConfig contains messaging options specific to the WebPush protocol.
278
285
//
279
286
// See https://tools.ietf.org/html/rfc8030#section-5 for additional details, and supported
@@ -282,7 +289,7 @@ type WebpushConfig struct {
282
289
Headers map [string ]string `json:"headers,omitempty"`
283
290
Data map [string ]string `json:"data,omitempty"`
284
291
Notification * WebpushNotification `json:"notification,omitempty"`
285
- FcmOptions * WebpushFcmOptions `json:"fcmOptions ,omitempty"`
292
+ FcmOptions * WebpushFcmOptions `json:"fcm_options ,omitempty"`
286
293
}
287
294
288
295
// WebpushNotificationAction represents an action that can be performed upon receiving a WebPush notification.
@@ -398,8 +405,9 @@ type WebpushFcmOptions struct {
398
405
// See https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html
399
406
// for more details on supported headers and payload keys.
400
407
type APNSConfig struct {
401
- Headers map [string ]string `json:"headers,omitempty"`
402
- Payload * APNSPayload `json:"payload,omitempty"`
408
+ Headers map [string ]string `json:"headers,omitempty"`
409
+ Payload * APNSPayload `json:"payload,omitempty"`
410
+ FCMOptions * APNSFCMOptions `json:"fcm_options,omitempty"`
403
411
}
404
412
405
413
// APNSPayload is the payload that can be included in an APNS message.
@@ -608,6 +616,16 @@ type ApsAlert struct {
608
616
LaunchImage string `json:"launch-image,omitempty"`
609
617
}
610
618
619
+ // APNSFCMOptions contains additional options for features provided by the FCM Aps SDK.
620
+ type APNSFCMOptions struct {
621
+ AnalyticsLabel string `json:"analytics_label,omitempty"`
622
+ }
623
+
624
+ // FCMOptions contains additional options to use across all platforms.
625
+ type FCMOptions struct {
626
+ AnalyticsLabel string `json:"analytics_label,omitempty"`
627
+ }
628
+
611
629
// ErrorInfo is a topic management error.
612
630
type ErrorInfo struct {
613
631
Index int
0 commit comments