Fetching Remote Config fails only in iOS / Flutter

Viewed 502

I have setup Firebase Remote Config for my Flutter application.

final remoteConfig = RemoteConfig.instance;

final defaultValues = <String, dynamic>{
  'default_url': '',
};

await remoteConfig.setDefaults(defaultValues);
RemoteConfigValue(null, ValueSource.valueStatic);

try {
  await remoteConfig.setConfigSettings(RemoteConfigSettings(
    fetchTimeout: const Duration(seconds: 10),
    minimumFetchInterval: const Duration(hours: 1),
  ));
  await remoteConfig.fetchAndActivate();
} on PlatformException catch (exception) {
  print(exception);
} catch (exception) {
  print('Unable to fetch remote config. Cached or default values will be '
      'used');
  print(exception);
}

It works fine on Android emulator but it outputs the error only when running on an iOS simulator and an actual device(my iPhone).

flutter: Unable to fetch remote config. Cached or default values will be used
flutter: [firebase_remote_config/internal] internal remote config fetch error

And, this started happening after upgrading to Flutter 2 (2.2.3).

Why is this happening?

Thanks for the help.

0 Answers
Related