@@ -51,6 +51,7 @@ public class MulticastMessage {
51
51
private final AndroidConfig androidConfig ;
52
52
private final WebpushConfig webpushConfig ;
53
53
private final ApnsConfig apnsConfig ;
54
+ private final FcmOptions fcmOptions ;
54
55
55
56
private MulticastMessage (Builder builder ) {
56
57
this .tokens = builder .tokens .build ();
@@ -64,14 +65,16 @@ private MulticastMessage(Builder builder) {
64
65
this .androidConfig = builder .androidConfig ;
65
66
this .webpushConfig = builder .webpushConfig ;
66
67
this .apnsConfig = builder .apnsConfig ;
68
+ this .fcmOptions = builder .fcmOptions ;
67
69
}
68
70
69
71
List <Message > getMessageList () {
70
72
Message .Builder builder = Message .builder ()
71
73
.setNotification (this .notification )
72
74
.setAndroidConfig (this .androidConfig )
73
75
.setApnsConfig (this .apnsConfig )
74
- .setWebpushConfig (this .webpushConfig );
76
+ .setWebpushConfig (this .webpushConfig )
77
+ .setFcmOptions (this .fcmOptions );
75
78
if (this .data != null ) {
76
79
builder .putAllData (this .data );
77
80
}
@@ -99,6 +102,7 @@ public static class Builder {
99
102
private AndroidConfig androidConfig ;
100
103
private WebpushConfig webpushConfig ;
101
104
private ApnsConfig apnsConfig ;
105
+ private FcmOptions fcmOptions ;
102
106
103
107
private Builder () {}
104
108
@@ -170,6 +174,15 @@ public Builder setApnsConfig(ApnsConfig apnsConfig) {
170
174
return this ;
171
175
}
172
176
177
+ /**
178
+ * Sets the {@link FcmOptions}, which can be overridden by the platform-specific {@code
179
+ * fcm_options} fields.
180
+ */
181
+ public Builder setFcmOptions (FcmOptions fcmOptions ) {
182
+ this .fcmOptions = fcmOptions ;
183
+ return this ;
184
+ }
185
+
173
186
/**
174
187
* Adds the given key-value pair to the message as a data field. Key or the value may not be
175
188
* null.
0 commit comments