Skip to content

Commit 375c4fb

Browse files
authored
Copying fcmOptions when multicasting messages (#716)
1 parent 45905e4 commit 375c4fb

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/messaging/messaging.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ export class Messaging implements FirebaseServiceInterface {
365365
data: copy.data,
366366
notification: copy.notification,
367367
webpush: copy.webpush,
368+
fcmOptions: copy.fcmOptions,
368369
};
369370
});
370371
return this.sendAll(messages, dryRun);

test/unit/messaging/messaging.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,7 @@ describe('Messaging', () => {
897897
data: {key: 'value'},
898898
notification: {title: 'test title'},
899899
webpush: {data: {webKey: 'webValue'}},
900+
fcmOptions: {analyticsLabel: 'label'},
900901
};
901902
return messaging.sendMulticast(multicast)
902903
.then((response: BatchResponse) => {
@@ -912,6 +913,7 @@ describe('Messaging', () => {
912913
expect(message.data).to.be.deep.equal(multicast.data);
913914
expect(message.notification).to.deep.equal(multicast.notification);
914915
expect(message.webpush).to.deep.equal(multicast.webpush);
916+
expect(message.fcmOptions).to.deep.equal(multicast.fcmOptions);
915917
});
916918
});
917919
});

0 commit comments

Comments
 (0)