AppRewardedInterstitialAd.fromKey constructor

AppRewardedInterstitialAd.fromKey({
  1. required String configKey,
})

Implementation

factory AppRewardedInterstitialAd.fromKey({required String configKey}) {
  try {
    final data = FirebaseRemoteConfig.instance.getString(configKey);
    final json = jsonDecode(data);
    final config = RewardedConfig.fromJson(json);
    return AppRewardedInterstitialAd.setup(config: config);
  } catch (e, st) {
    log('', name: 'RewardedInterstitialAd.fromKey', error: e, stackTrace: st);
    return AppRewardedInterstitialAd.setup(config: RewardedConfig());
  }
}