@@ -51,6 +51,7 @@ public class MulticastMessage {
5151 private final AndroidConfig androidConfig ;
5252 private final WebpushConfig webpushConfig ;
5353 private final ApnsConfig apnsConfig ;
54+ private final FcmOptions fcmOptions ;
5455
5556 private MulticastMessage (Builder builder ) {
5657 this .tokens = builder .tokens .build ();
@@ -64,14 +65,16 @@ private MulticastMessage(Builder builder) {
6465 this .androidConfig = builder .androidConfig ;
6566 this .webpushConfig = builder .webpushConfig ;
6667 this .apnsConfig = builder .apnsConfig ;
68+ this .fcmOptions = builder .fcmOptions ;
6769 }
6870
6971 List <Message > getMessageList () {
7072 Message .Builder builder = Message .builder ()
7173 .setNotification (this .notification )
7274 .setAndroidConfig (this .androidConfig )
7375 .setApnsConfig (this .apnsConfig )
74- .setWebpushConfig (this .webpushConfig );
76+ .setWebpushConfig (this .webpushConfig )
77+ .setFcmOptions (this .fcmOptions );
7578 if (this .data != null ) {
7679 builder .putAllData (this .data );
7780 }
@@ -99,6 +102,7 @@ public static class Builder {
99102 private AndroidConfig androidConfig ;
100103 private WebpushConfig webpushConfig ;
101104 private ApnsConfig apnsConfig ;
105+ private FcmOptions fcmOptions ;
102106
103107 private Builder () {}
104108
@@ -170,6 +174,15 @@ public Builder setApnsConfig(ApnsConfig apnsConfig) {
170174 return this ;
171175 }
172176
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+
173186 /**
174187 * Adds the given key-value pair to the message as a data field. Key or the value may not be
175188 * null.
0 commit comments