RewardedAdPreloader class
Google Mobile Ads Next-Gen SDK Preloader for RewardedAd.
- Inheritance
-
- Object
- NextGenAdPreloaderBase<
RewardedAd> - RewardedAdPreloader
Properties
- adType → AdType
-
finalinherited
- cacheTtl → Duration
-
finalinherited
- format → AdFormat
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- retryPolicy → AdRetryPolicy
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- useNativeBridge → bool
-
Whether to delegate preloading to the native
*AdPreloaderbridge instead of the Dart-managed preloader buffer. Defaults tofalseso ads are buffered once in Dart (supporting synchronous0.0mspollAd and Databuckets telemetry without double-loading).finalinherited
Methods
-
createPreloadedAd(
{required PreloadConfiguration config, ResponseInfo? responseInfo}) → RewardedAd -
Subclasses instantiate a preloaded
Twrapper when useNativeBridge is active.override -
destroy(
String preloadId) → Future< void> -
Destroys the preloader and disposes all buffered ads for
preloadId.inherited -
destroyAll(
) → Future< void> -
Destroys all active preloaders and disposes all buffered ads for this ad format.
inherited
-
getConfiguration(
String preloadId) → PreloadConfiguration? -
Returns the PreloadConfiguration registered for
preloadId, ornullif not found.inherited -
getConfigurations(
) → Map< String, PreloadConfiguration> -
Returns an unmodifiable map of all active PreloadConfigurations for this format.
inherited
-
getNumAdsAvailable(
String preloadId) → int -
Returns the number of fresh preloaded ads currently buffered for
preloadId.inherited -
isAdAvailable(
String preloadId) → bool -
Returns
trueif at least one fresh preloaded ad is available forpreloadId.inherited -
loadSingleAd(
{required String preloadId, required PreloadConfiguration config, required void onLoaded(RewardedAd ad), required void onFailed(LoadAdError error)}) → void -
Subclasses implement single-ad loading for their specific format.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pollAd(
String preloadId) → RewardedAd? -
Retrieves and removes the next available preloaded ad for
preloadIdin 0.0ms.inherited -
pollAdAsync(
String preloadId) → Future< RewardedAd?> -
Asynchronous variant of pollAd that polls the native Next-Gen Preloader
when useNativeBridge is enabled and awaits native binding before returning.
inherited
-
seedAdForTesting(
String preloadId, RewardedAd ad, {PreloadConfiguration? configuration, PreloadCallback? callback}) → void -
Visible for unit testing: directly seeds a preloaded
adinto the buffer forpreloadId.inherited -
start(
String preloadId, PreloadConfiguration configuration, [PreloadCallback? callback]) → Future< bool> -
Starts preloading ads for
preloadIdusingconfigurationand optionalcallback.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → RewardedAdPreloader
-
final