capacitor-community / admob

Community plugin for using Google AdMob
MIT License
223 stars 69 forks source link

interstitial ad dismissed listener not work on ios emulator #314

Closed sksk008 closed 8 months ago

sksk008 commented 9 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

    AdMob.addListener(InterstitialAdPluginEvents.Loaded, (info: AdLoadInfo) => {
      // Subscribe prepared interstitial
      console.log("adloaded")
    });
          AdMob.addListener(InterstitialAdPluginEvents.Dismissed, ( ) => {
        // Subscribe prepared interstitial
        console.log("Dismissed")
      });
          AdMob.addListener(InterstitialAdPluginEvents.Showed, ( ) => {
        // Subscribe prepared interstitial
        console.log("Showed")
      });

i am using test ad and i have list all 3 listener but whenever i click on close ad dismissed listener never called

Expected behavior should print adloaded Showed Dismissed

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context It is working perfect on android test device.

sksk008 commented 8 months ago
  AdMob.addListener(InterstitialAdPluginEvents.Dismissed, ( ) => {
        this.zone.run(() => {
     console.log("Interstitial Dismissed");
  })
});

i have already tried with NgZone but still not work.

sksk008 commented 8 months ago

it was my mistake after AdMob.showInterstitial() method i am immediately calling AdMob.prepareInterstitial() but i have to called this AdMob.prepareInterstitial() method after ad dismissed . i can figure out this mistake by this.