Skip to content

Commit b160661

Browse files
authored
Merge branch 'firebase:main' into main
2 parents d4fdd50 + 7fbad72 commit b160661

File tree

5 files changed

+52
-8
lines changed

5 files changed

+52
-8
lines changed

etc/firebase-admin.messaging.api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Agent } from 'http';
88

99
// @public
1010
export interface AndroidConfig {
11+
bandwidthConstrainedOk?: boolean;
1112
collapseKey?: string;
1213
data?: {
1314
[key: string]: string;
@@ -17,6 +18,7 @@ export interface AndroidConfig {
1718
notification?: AndroidNotification;
1819
priority?: ('high' | 'normal');
1920
restrictedPackageName?: string;
21+
restrictedSatelliteOk?: boolean;
2022
ttl?: number;
2123
}
2224

package-lock.json

Lines changed: 28 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/messaging/messaging-api.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,18 @@ export interface AndroidConfig {
428428
* the app while the device is in direct boot mode.
429429
*/
430430
directBootOk?: boolean;
431+
432+
/**
433+
* A boolean indicating whether messages will be allowed to be delivered to
434+
* the app while the device is on a bandwidth constrained network.
435+
*/
436+
bandwidthConstrainedOk?: boolean;
437+
438+
/**
439+
* A boolean indicating whether messages will be allowed to be delivered to
440+
* the app while the device is on a restricted satellite network.
441+
*/
442+
restrictedSatelliteOk?: boolean;
431443
}
432444

433445
/**

src/messaging/messaging-internal.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ function validateAndroidConfig(config: AndroidConfig | undefined): void {
422422
collapseKey: 'collapse_key',
423423
restrictedPackageName: 'restricted_package_name',
424424
directBootOk: 'direct_boot_ok',
425+
bandwidthConstrainedOk: 'bandwidth_constrained_ok',
426+
restrictedSatelliteOk: 'restricted_satellite_ok',
425427
};
426428
renameProperties(config, propertyMappings);
427429
}

test/unit/messaging/messaging.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,6 +1899,8 @@ describe('Messaging', () => {
18991899
collapseKey: 'test.key',
19001900
restrictedPackageName: 'test.package',
19011901
directBootOk: true,
1902+
bandwidthConstrainedOk: true,
1903+
restrictedSatelliteOk: true,
19021904
notification: {
19031905
clickAction: 'test.click.action',
19041906
titleLocKey: 'title.loc.key',
@@ -1927,6 +1929,8 @@ describe('Messaging', () => {
19271929
collapse_key: 'test.key',
19281930
restricted_package_name: 'test.package',
19291931
direct_boot_ok: true,
1932+
bandwidth_constrained_ok: true,
1933+
restricted_satellite_ok: true,
19301934
notification: {
19311935
click_action: 'test.click.action',
19321936
title_loc_key: 'title.loc.key',
@@ -1983,6 +1987,8 @@ describe('Messaging', () => {
19831987
collapseKey: 'test.key',
19841988
restrictedPackageName: 'test.package',
19851989
directBootOk: true,
1990+
bandwidthConstrainedOk: true,
1991+
restrictedSatelliteOk: true,
19861992
ttl: 5,
19871993
data: {
19881994
k1: 'v1',
@@ -2031,6 +2037,8 @@ describe('Messaging', () => {
20312037
collapse_key: 'test.key',
20322038
restricted_package_name: 'test.package',
20332039
direct_boot_ok: true,
2040+
bandwidth_constrained_ok: true,
2041+
restricted_satellite_ok: true,
20342042
ttl: '0.005000000s', // 5 ms = 5,000,000 ns
20352043
data: {
20362044
k1: 'v1',

0 commit comments

Comments
 (0)