5-2. Interstitial Ads for Flutter
화면 전체를 덮는 형태의 광고입니다.
Before you begin
05. Flutter-Plugin GuideCreating an instance of Interstitial Ads.
...
OAMInterstitial _oamInterstitial = OAMInterstitial()
...Request an interstitial ad.
A request is made to load() interstitial ad.
The parameters are placementId and InterstitialCallBackListener.
The placementId for the interstitial ad can be created in the ONE AdMax console.
oamInterstitial.load(
placementId: interstitialPlacementId,
);Excessive calls to the load() API may result in being blocked.
Set the event listener for the interstitial ad.
Set a listener for events that occur when loading a interstial ad.
_oamInterstitial.load(
callback: InterstitialCallBackListener(
onLoaded: onLoaded,
onLoadFailed: onLoadFailed,
onOpened: onOpened,
onOpenFailed: onOpenFailed,
onClosed: onClosed,
onClicked: onClicked,
),
);Display the interstitial ad
_oamInterstitial.show();Custom options for interstitial ads.
backgroundColor
Change background color and transparency. Use a Color value.
isHideCloseButton
Set whether to display the close button in the top-right corner.
default : false
closeBtnMargin.left
Left margin of the close button.
default : 28dp
closeBtnMargin.top
Top margin of the close button.
default : 20dp
closeBtnMargin.right
Right margin of the close button..
default : 20dp
closeBtnMargin.bottom
Bottom margin of the close button.
default : 0dp
isDisableBackButton
Do not use the back button to close..
deault : false
EndingText.isShow
Whether to display the ending message. default : false
EndingText.text
Ending message. default : "뒤로 가기를 한 번 더 누르시면 종료됩니다."
EndingText.size
Ending message size.
default : 11sp
EndingText.color
Ending message test color.
default : white
EndingText.align
Ending message gravity.
default : Right
Sample code for interstitial ads.
OAMInterstitial _oamInterstitial = OAMInterstitial()
_oamInterstitial.load(
placementId: interstitialPlacementId,
callback: InterstitialCallBackListener(
onLoaded: onLoaded,
onLoadFailed: onLoadFailed,
onOpened: onOpened,
onOpenFailed: onOpenFailed,
onClosed: onClosed,
onClicked: onClicked,
),
);
_oamInterstitial.interstitialConfig.isHideCloseButton = false;
_oamInterstitial.interstitialConfig.backgroundColor = Colors.red;
_oamInterstitial.interstitialConfig.endingText = const EndingText(
'Sample Text',
12,
Colors.white,
TextAlign.center,
true,
);
_oamInterstitial.interstitialConfig.closeBtnMargin = const CloseBtnMargin(
top: 10,
left: 10,
right: 10,
bottom: 10,
);
_oamInterstitial.show();Last updated