Reputation: 1296
I first call
this.admobFree.interstitial.prepare()
.then(() => {
this.interstitialPrepared = true;
console.log('AdMob Interstitial Ad is prepared, will be presented if autoShow is true, otherwise, call showInterstitial().');
})
.catch((err) => {
console.error(err);
})
And this.interstitialPrepared = true;
is called so I assume my ad is ready.
But if I call this.admobFree.interstitial.show()
after my this.interstitialPrepared
var switch to true
, I still have the following error "ERROR: interstitial not ready yet.".
Notice : It works well with the following config :
this.adMobProvider.interstitialConfig = {
autoShow: false,
isTesting : true
};
But not when I want to test with real ads
this.adMobProvider.interstitialConfig = {
autoShow: false,
isTesting : false,
id:"ca-app-pub-277368299xxxxxxxx"
};
Upvotes: 2
Views: 2014
Reputation: 361
In my case autoShow: true
worked for me. Remember when autoShow is true you don't need to call the intersit
Upvotes: -1
Reputation: 71
I had the same problem and I did this way:
interstitial.show()
after interstitial.prepare().then(..)
;INTERSTITIAL_LOAD
and INTERSTITIAL_LOAD_FAIL
;Example:
this.admobFree.on(this.admobFree.events.INTERSTITIAL_LOAD).subscribe(() => { this.admobFree.interstitial.show().then(() => { // Show successful }).catch((errorShow) => { // ... }); }); this.admobFree.on(this.admobFree.events.INTERSTITIAL_LOAD_FAIL).subscribe(() => { // ... });
I hope to help you.
Upvotes: 3