From 0332f4a98d6231e038372a8ad529873f90f4f96b Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Tue, 3 Mar 2026 16:44:18 -0500 Subject: [PATCH] feat: pull push gateway URL from environment (#5878) --- lib/config/setting_keys.dart | 11 ++++------- lib/pangea/common/config/environment.dart | 4 ++++ lib/utils/background_push.dart | 6 +++++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/config/setting_keys.dart b/lib/config/setting_keys.dart index 04a5f854a..ffb867a00 100644 --- a/lib/config/setting_keys.dart +++ b/lib/config/setting_keys.dart @@ -23,14 +23,11 @@ enum AppSettings { showNoGoogle('chat.fluffy.show_no_google', false), unifiedPushRegistered('chat.fluffy.unifiedpush.registered', false), unifiedPushEndpoint('chat.fluffy.unifiedpush.endpoint', ''), - pushNotificationsGatewayUrl( - 'pushNotificationsGatewayUrl', - // #Pangea - // 'https://push.fluffychat.im/_matrix/push/v1/notify', - 'https://sygnal.pangea.chat/_matrix/push/v1/notify', - // Pangea# - ), // #Pangea + // pushNotificationsGatewayUrl( + // 'pushNotificationsGatewayUrl', + // 'https://push.fluffychat.im/_matrix/push/v1/notify', + // ), // pushNotificationsPusherFormat( // 'pushNotificationsPusherFormat', // 'event_id_only', diff --git a/lib/pangea/common/config/environment.dart b/lib/pangea/common/config/environment.dart index dc5ae9cc7..f559d68af 100644 --- a/lib/pangea/common/config/environment.dart +++ b/lib/pangea/common/config/environment.dart @@ -81,6 +81,10 @@ class Environment { return envEntry; } + static String get pushGatewayUrl => isStagingEnvironment + ? 'https://sygnal.staging.pangea.chat/_matrix/push/v1/notify' + : 'https://sygnal.pangea.chat/_matrix/push/v1/notify'; + static String get choreoApiKey { return appConfigOverride?.choreoApiKey ?? dotenv.env['CHOREO_API_KEY'] ?? diff --git a/lib/utils/background_push.dart b/lib/utils/background_push.dart index f2c4b18b3..a36318a0e 100644 --- a/lib/utils/background_push.dart +++ b/lib/utils/background_push.dart @@ -36,6 +36,7 @@ import 'package:unifiedpush_ui/unifiedpush_ui.dart'; import 'package:fluffychat/l10n/l10n.dart'; import 'package:fluffychat/main.dart'; +import 'package:fluffychat/pangea/common/config/environment.dart'; import 'package:fluffychat/pangea/common/utils/error_handler.dart'; import 'package:fluffychat/pangea/common/utils/firebase_analytics.dart'; import 'package:fluffychat/pangea/join_codes/knock_room_extension.dart'; @@ -523,7 +524,10 @@ class BackgroundPush { } } await setupPusher( - gatewayUrl: AppSettings.pushNotificationsGatewayUrl.value, + // #Pangea + // gatewayUrl: AppSettings.pushNotificationsGatewayUrl.value, + gatewayUrl: Environment.pushGatewayUrl, + // Pangea# token: _fcmToken, ); }