Charly berthet
Charly berthet

Reputation: 1296

AdmobFree interstitial.show() - ERROR: interstitial not ready yet

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

Answers (2)

Ali Hayder
Ali Hayder

Reputation: 361

In my case autoShow: trueworked for me. Remember when autoShow is true you don't need to call the intersit

Upvotes: -1

I had the same problem and I did this way:

  1. I did not put the interstitial.show() after interstitial.prepare().then(..);
  2. I subscribed these events: INTERSTITIAL_LOAD and INTERSTITIAL_LOAD_FAIL;
  3. I only showed it loaded successfully;

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

Related Questions