showRewardAd method

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

Implementation

@override
void showRewardAd({AdModuleWithCallBacks? adModuleCallBacks}) {
  UnityAds.showVideoAd(
    placementId: GlobalAdVariables.adNetworkIds?['unity']?.rewardId ?? "",
    onStart: (placementId) {
      if (adModuleCallBacks != null) {
        if (adModuleCallBacks.onAdStarted != null) {
          adModuleCallBacks.onAdStarted!();
        }
      }
    },
    onClick: (placementId) {},
    onSkipped: (placementId) {
      if (adModuleCallBacks != null) {
        if (adModuleCallBacks.onCloseEvent != null) {
          adModuleCallBacks.onCloseEvent!();
        }
      }
    },
    onComplete: (placementId) {
      if (adModuleCallBacks != null) {
        if (adModuleCallBacks.onCloseEvent != null) {
          adModuleCallBacks.onCloseEvent!();
        }
      }
    },
    onFailed: (placementId, error, message) {
      if (adModuleCallBacks != null) {
        if (adModuleCallBacks.onFailed != null) {
          adModuleCallBacks.onFailed!();
        }
      }
    },
  );
}