From 582d1651747ce886a3658105426482cb63d190d8 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 23 Oct 2025 20:09:44 +0000 Subject: [PATCH 1/3] feat(messaging): Add bandwidthConstrainedOk and restrictedSatelliteOk to AndroidConfig Adds two new optional boolean properties, `bandwidthConstrainedOk` and `restrictedSatelliteOk`, to the `AndroidConfig` type in the messaging API. This change includes: - Updating the `AndroidConfig` interface in `src/messaging/messaging-api.ts`. - Adding the corresponding property mappings in `src/messaging/messaging-internal.ts`. - Updating unit tests in `test/unit/messaging/messaging.spec.ts` to cover the new properties. --- src/messaging/messaging-api.ts | 12 ++++++++++++ src/messaging/messaging-internal.ts | 2 ++ test/unit/messaging/messaging.spec.ts | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/src/messaging/messaging-api.ts b/src/messaging/messaging-api.ts index a305ec68b3..b34f7f9704 100644 --- a/src/messaging/messaging-api.ts +++ b/src/messaging/messaging-api.ts @@ -428,6 +428,18 @@ export interface AndroidConfig { * the app while the device is in direct boot mode. */ directBootOk?: boolean; + + /** + * A boolean indicating whether the message is allowed to be delivered in + * a low-bandwidth environment. + */ + bandwidthConstrainedOk?: boolean; + + /** + * A boolean indicating whether the message is allowed to be delivered + * via satellite. + */ + restrictedSatelliteOk?: boolean; } /** diff --git a/src/messaging/messaging-internal.ts b/src/messaging/messaging-internal.ts index 311d2af4be..6427b98e0a 100644 --- a/src/messaging/messaging-internal.ts +++ b/src/messaging/messaging-internal.ts @@ -422,6 +422,8 @@ function validateAndroidConfig(config: AndroidConfig | undefined): void { collapseKey: 'collapse_key', restrictedPackageName: 'restricted_package_name', directBootOk: 'direct_boot_ok', + bandwidthConstrainedOk: 'bandwidth_constrained_ok', + restrictedSatelliteOk: 'restricted_satellite_ok', }; renameProperties(config, propertyMappings); } diff --git a/test/unit/messaging/messaging.spec.ts b/test/unit/messaging/messaging.spec.ts index d51c186c48..af4dad1d4d 100644 --- a/test/unit/messaging/messaging.spec.ts +++ b/test/unit/messaging/messaging.spec.ts @@ -1899,6 +1899,8 @@ describe('Messaging', () => { collapseKey: 'test.key', restrictedPackageName: 'test.package', directBootOk: true, + bandwidthConstrainedOk: true, + restrictedSatelliteOk: true, notification: { clickAction: 'test.click.action', titleLocKey: 'title.loc.key', @@ -1927,6 +1929,8 @@ describe('Messaging', () => { collapse_key: 'test.key', restricted_package_name: 'test.package', direct_boot_ok: true, + bandwidth_constrained_ok: true, + restricted_satellite_ok: true, notification: { click_action: 'test.click.action', title_loc_key: 'title.loc.key', @@ -1983,6 +1987,8 @@ describe('Messaging', () => { collapseKey: 'test.key', restrictedPackageName: 'test.package', directBootOk: true, + bandwidthConstrainedOk: true, + restrictedSatelliteOk: true, ttl: 5, data: { k1: 'v1', @@ -2031,6 +2037,8 @@ describe('Messaging', () => { collapse_key: 'test.key', restricted_package_name: 'test.package', direct_boot_ok: true, + bandwidth_constrained_ok: true, + restricted_satellite_ok: true, ttl: '0.005000000s', // 5 ms = 5,000,000 ns data: { k1: 'v1', From 0cc66540117c23d6f949eb83e316d3f1adf5f249 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 24 Oct 2025 16:17:06 +0000 Subject: [PATCH 2/3] feat(messaging): Add bandwidthConstrainedOk and restrictedSatelliteOk to AndroidConfig Adds two new optional boolean properties, `bandwidthConstrainedOk` and `restrictedSatelliteOk`, to the `AndroidConfig` type in the messaging API. This change includes: - Updating the `AndroidConfig` interface in `src/messaging/messaging-api.ts`. - Adding the corresponding property mappings in `src/messaging/messaging-internal.ts`. - Updating unit tests in `test/unit/messaging/messaging.spec.ts` to cover the new properties. - Updating the public API documentation. --- etc/firebase-admin.messaging.api.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/firebase-admin.messaging.api.md b/etc/firebase-admin.messaging.api.md index 1ad50f85f6..b93ba7e58e 100644 --- a/etc/firebase-admin.messaging.api.md +++ b/etc/firebase-admin.messaging.api.md @@ -8,6 +8,7 @@ import { Agent } from 'http'; // @public export interface AndroidConfig { + bandwidthConstrainedOk?: boolean; collapseKey?: string; data?: { [key: string]: string; @@ -17,6 +18,7 @@ export interface AndroidConfig { notification?: AndroidNotification; priority?: ('high' | 'normal'); restrictedPackageName?: string; + restrictedSatelliteOk?: boolean; ttl?: number; } From 6a101920896faab146144f528eede69c7a9cf853 Mon Sep 17 00:00:00 2001 From: Lahiru Maramba Date: Mon, 23 Mar 2026 20:39:45 +0000 Subject: [PATCH 3/3] fix docstrings --- src/messaging/messaging-api.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/messaging/messaging-api.ts b/src/messaging/messaging-api.ts index b34f7f9704..516c07bb44 100644 --- a/src/messaging/messaging-api.ts +++ b/src/messaging/messaging-api.ts @@ -430,14 +430,14 @@ export interface AndroidConfig { directBootOk?: boolean; /** - * A boolean indicating whether the message is allowed to be delivered in - * a low-bandwidth environment. + * A boolean indicating whether messages will be allowed to be delivered to + * the app while the device is on a bandwidth constrained network. */ bandwidthConstrainedOk?: boolean; /** - * A boolean indicating whether the message is allowed to be delivered - * via satellite. + * A boolean indicating whether messages will be allowed to be delivered to + * the app while the device is on a restricted satellite network. */ restrictedSatelliteOk?: boolean; }