From 170cc96d33f68ea3352d45fdd0f071b65fb5596c Mon Sep 17 00:00:00 2001 From: Jude Selase Kwashie <64037520+SelaseKay@users.noreply.github.com> Date: Tue, 29 Oct 2024 10:06:53 +0000 Subject: [PATCH] fix(remote_config): ensure all listeners fire on onConfigUpdated (#13512) * fix(remote_config): ensure all listeners fire on onConfigUpdated * chore: run format --- .../method_channel_firebase_remote_config.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/firebase_remote_config/firebase_remote_config_platform_interface/lib/src/method_channel/method_channel_firebase_remote_config.dart b/packages/firebase_remote_config/firebase_remote_config_platform_interface/lib/src/method_channel/method_channel_firebase_remote_config.dart index f916e466fc49..4cc08ba89d74 100644 --- a/packages/firebase_remote_config/firebase_remote_config_platform_interface/lib/src/method_channel/method_channel_firebase_remote_config.dart +++ b/packages/firebase_remote_config/firebase_remote_config_platform_interface/lib/src/method_channel/method_channel_firebase_remote_config.dart @@ -293,13 +293,17 @@ class MethodChannelFirebaseRemoteConfig extends FirebaseRemoteConfigPlatform { static const EventChannel _eventChannelConfigUpdated = EventChannel('plugins.flutter.io/firebase_remote_config_updated'); + Stream? _onConfigUpdatedStream; + @override Stream get onConfigUpdated { - return _eventChannelConfigUpdated.receiveBroadcastStream({ + _onConfigUpdatedStream ??= + _eventChannelConfigUpdated.receiveBroadcastStream({ 'appName': app.name, }).map((event) { final updatedKeys = Set.from(event); return RemoteConfigUpdate(updatedKeys); }); + return _onConfigUpdatedStream!; } }