loadRewardAd method

  1. @override
void loadRewardAd({
  1. AdModuleWithCallBacks? adModuleCallBacks,
})
override

Implementation

@override
void loadRewardAd({AdModuleWithCallBacks? adModuleCallBacks}) {
  UnityAds.load(
    placementId: GlobalAdVariables.adNetworkIds?['unity']?.rewardId ?? "",
    onComplete: (placementId) {
      if (adModuleCallBacks != null) {
        if (adModuleCallBacks.onAdLoaded != null) {
          adModuleCallBacks.onAdLoaded!();
        }
      }
    },
    onFailed: (placementId, error, message) {
      if (adModuleCallBacks != null) {
        if (adModuleCallBacks.onLoadFailed != null) {
          adModuleCallBacks.onLoadFailed!();
        }
      }
    },
  );
}