ratson / cordova-plugin-admob-free

New development has been moved to "admob-plus-cordova", https://github.com/admob-plus/admob-plus/tree/master/packages/cordova
https://github.com/admob-plus/admob-plus
MIT License
499 stars 214 forks source link

interstitial.show() - ERROR: interstitial not ready yet. #146

Open charlyBerthet opened 6 years ago

charlyBerthet commented 6 years ago

Hello,

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"
};
Riyaz0001 commented 5 years ago

same problem here in ionic 3

ahayder commented 5 years ago

In my case autoShow: true worked for me. Remember when autoShow is true you don't need to call the interstitial.show() function. Hope it works. Cheers!!!

thepianist2 commented 3 years ago

Yes, in my case this is working example:

//INTERSTITIAL
this.admobFree.interstitial.config(this.interstitialConfig);
this.admobFree.interstitial.prepare().then(() => {
  console.log('INTERSTIAL LOADED AND SHOWING')
}).catch(e =>
  console.log('ERRORL: ', e)
);