-
Notifications
You must be signed in to change notification settings - Fork 338
1.4 Methods for Interstitial
Raymond Xie edited this page Apr 1, 2017
·
4 revisions
Purpose: prepare an interstitial Ad for showing.
Params:
- adId, string, Ad unit Id for the full screen Ad.
- options, string, see *AdMob.setOptions()
- success, function, callback when success, can be null or missing.
- fail, function, callback when fail, can be null or missing.
Extra key/value for param options
- adId, string, Ad unit Id for this interstitial.
- success, function, callback when success.
- error, function, call back when fail.
Note: it will take some time to get Ad resource before it can be showed. It's more recommended by AdMob official, you may buffer the Ad by calling requestInterstitial, and show it later.
Purpose: show interstitial Ad when it's ready.
Purpose: check to confirm interstitial Ad is ready to show.
Example Code:
// prepare at beginning of a game level
AdMob.prepareInterstitial({
adId: admobid.interstitial,
autoShow: false
});
// check and show it at end of a game level
AdMob.isInterstitialReady(function(isready){
if(isready) AdMob.showInterstitial();
});