RewardedAdService class

Service dedicated to managing the lifecycle of Rewarded Video Ads.

Features:

  • AdMob Policy Guard: 4-hour max-age cache invalidation.
  • AdMob Policy Guard: Anti-collision full-screen presentation lock.
  • Verified user reward callbacks.
  • Server-Side Verification (SSV) options support.
  • Exponential backoff retry logic with automatic cancellation on disposal.
  • Automatic Impression-Level Ad Revenue (ILRD) tracking.

Constructors

RewardedAdService()

Properties

hashCode → int
The hash code for this object.
no setterinherited
isAdAvailable → bool
Whether a rewarded ad is loaded and ready to be shown.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Disposes active ad and cancels state.
loadAd({String? adUnitId, AdRequest? request, VoidCallback? onLoaded, dynamic onFailedToLoad(LoadAdError error)?}) → void
Loads a Rewarded Ad.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
showAd({required OnUserEarnedRewardCallback onUserEarnedReward, ServerSideVerificationOptions? serverSideVerificationOptions, VoidCallback? onAdShowedFullScreenContent, VoidCallback? onAdDismissedFullScreenContent, dynamic onAdFailedToShowFullScreenContent(AdError error)?, VoidCallback? onAdClicked, VoidCallback? onAdImpression, OnPaidEventCallback? onPaidEvent}) → void
Displays the loaded Rewarded ad and triggers reward callback when user earns reward.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

maxAdAge → const Duration
Max age before cached ad is considered stale according to AdMob policy (4 hours).
maxRetryAttempts → const int
Max retry attempts on load failure.