From 7c6956ce71501fc24b571fe755c97fc94cdc2274 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/2] 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 f955c85892a56fc6b490a16398ce255a333f6a13 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/2] 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; }