loadRewardedAd static method

Future<void> loadRewardedAd({
  1. required String adUnitId,
  2. dynamic onComplete(
    1. String adUnitId
    )?,
  3. dynamic onFailed(
    1. String adUnitId,
    2. LoadError error,
    3. String errorMessage
    )?,
})

Load a placement to make it available to show. Ads generally take a few seconds to finish loading before they can be shown.

  • adUnitId - The ID of the rewarded ad unit.
  • onComplete - callback triggered when a load request has successfully filled the specified adUnitId with an ad that is ready to show.
  • onFailed - called when load request has failed to load an ad for a requested placement.

Implementation

static Future<void> loadRewardedAd({
  required String adUnitId,
  Function(String adUnitId)? onComplete,
  Function(String adUnitId, LoadError error, String errorMessage)? onFailed,
}) async {
  await _loadAd(
    methodName: loadRewardedAdMethod,
    adUnitId: adUnitId,
    onComplete: onComplete,
    onFailed: onFailed,
  );
}