AdBreakPlacement.interstitial constructor
AdBreakPlacement.interstitial({
- required BreakType type,
- String? name,
- H5BeforeAdCallback? beforeAd,
- H5AfterAdCallback? afterAd,
- H5AdBreakDoneCallback? adBreakDone,
Convenience factory to create an interstitial ad configuration.
The following parameters are available:
name
: A name for this particular ad placement within your game. It is an internal identifier, and is not shown to the player. Recommended.beforeAd
: Called before the ad is displayed. The game should pause and mute the sound. These actions must be done synchronously. The ad will be displayed immediately after this callback finishes..afterAd
: Called after the ad is finished (for any reason). For rewarded ads, it is called after either adDismissed or adViewed, depending on player actionsadBreakDone
: Always called as the last step in anadBreak
, even if there was no ad shown. Takes as argument aplacementInfo
object. See AdBreakDonePlacementInfo, and: https://developers.google.com/ad-placement/apis/adbreak#adbreakdone_and_placementinfo
See: https://developers.google.com/ad-placement/apis#interstitials
Implementation
factory AdBreakPlacement.interstitial({
required BreakType type,
String? name,
H5BeforeAdCallback? beforeAd,
H5AfterAdCallback? afterAd,
H5AdBreakDoneCallback? adBreakDone,
}) {
assert(interstitialBreakType.contains(type),
'$type is not a valid interstitial placement type.');
return AdBreakPlacement(
type: type,
name: name,
beforeAd: beforeAd,
afterAd: afterAd,
adBreakDone: adBreakDone,
);
}