AppRewardedAd.fromKey constructor

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

Implementation

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