I configured Firebase Remote Config, and FlutterFlow generated the following utility file. On app launch, fetchAndActivate()
is called, and I get the default (or console) values correctly. However, after that initial activation, I never see any subsequent updates. Fetch/activate only runs once, and no code re-triggers on a later launch or after the interval. It appears that FlutterFlow is not automatically calling fetchAndActivate() again.
import 'package:firebase_remote_config/firebase_remote_config.dart';
Future initializeFirebaseRemoteConfig() async {
try {
await FirebaseRemoteConfig.instance.setConfigSettings(RemoteConfigSettings(
fetchTimeout: const Duration(minutes: 1),
minimumFetchInterval: const Duration(hours: 1),
));
await FirebaseRemoteConfig.instance.setDefaults(const {
'parameter1': '...',
'parameter2': '...',
});
// This runs exactly once, on initialization
await FirebaseRemoteConfig.instance.fetchAndActivate();
} catch (error) {
print(error);
}
}
String getRemoteConfigString(String key) =>
FirebaseRemoteConfig.instance.getString(key);
bool getRemoteConfigBool(String key) =>
FirebaseRemoteConfig.instance.getBool(key);
int getRemoteConfigInt(String key) =>
FirebaseRemoteConfig.instance.getInt(key);
double getRemoteConfigDouble(String key) =>
FirebaseRemoteConfig.instance.getDouble(key);
As far as I can tell, FlutterFlow hasn’t generated any code that calls fetch()
or fetchAndActivate()
again after initializeFirebaseRemoteConfig()
. According to Firebase’s docs, you must invoke fetch()
(or fetchAndActivate()
) again when you want to pick up new values once the minimum fetch interval passes. Since I don’t see any repeated invocation, I believe either:
I’m missing a step in FlutterFlow’s Remote Config setup, or
This is a bug in FlutterFlow’s Remote Config integration.
Could someone confirm whether FlutterFlow intends to automatically re-fetch/activate once the interval has elapsed? If not, where is the correct place to report this as a bug? Thanks!