internal remote config fetch error

This commit is contained in:
Vadim 2023-11-07 10:56:44 +01:00
parent b2b2aa5453
commit 98c96577fb
2 changed files with 3 additions and 7 deletions

View file

@ -50,14 +50,8 @@ class RemoteConfigService implements IRemoteConfigService {
}
}
@override
Future<void> fetchConfig() async {
// https://github.com/firebase/flutterfire/issues/6196#issuecomment-927751667
await Future.delayed(const Duration(seconds: 1));
await FirebaseRemoteConfig.instance.fetch();
}
Future<void> fetchConfig() => FirebaseRemoteConfig.instance.fetch();
@override
dynamic getValue(Feature feature) => FirebaseRemoteConfig.instance.getValue(feature.name).toValue(feature);
@override

View file

@ -26,6 +26,8 @@ class RemoteConfigProviderState extends State<RemoteConfigProvider> {
@override
void initState() {
super.initState();
// https://github.com/firebase/flutterfire/issues/6196#issuecomment-927751667
Future.delayed(const Duration(seconds: 1)).then((_) => widget.remoteConfigService.fetchConfig());
_updatesSubscription = widget.remoteConfigService.onConfigUpdated().listen(
_updateFeatures,
onError: (e) => log(e.toString()),