admob-plus / admob-plus

Trustable AdMob Plugin for Cordova, Capacitor, Ionic, React Native
https://admob-plus.github.io
MIT License
360 stars 150 forks source link

Ads not showing #616

Open willPHPwork opened 8 months ago

willPHPwork commented 8 months ago

Describe the bug admob-plus-cordova: 2.0.0-alpha.13 not showing any ads.

config.xml

<plugin name="admob-plus-cordova">
        <variable name="APP_ID_ANDROID" value="ca-app-pub-xxx" />
</plugin>

To Reproduce

document.addEventListener('deviceready', async () => {
    console.log('admob starting');
    await admob.start();
    console.log('ready');
});

asnc loadad () => {
    if(admob == 'undefined') return console.log('Admob not ready');

   console.log('admob getting ad');

    let interstitial = new admob.InterstitialAd({
          adUnitId: 'ca-app-pub-xxx',
    });

    await interstitial.load();
    await interstitial.show();
    // Nothing
    console.log('done');
};

Console shows // admob starting

When loadad called // admob getting ad

Console does not show ready or done.

1n3JgKl9pQ6cUMrW commented 8 months ago

Typo asnc loadad () => {

willPHPwork commented 8 months ago

Thanks. This was just some example code, the issue still remains. Nothing happens after await interstitial.load();

async showInterstilial() {
  if(!admob) return;

  let interstitial = new admob.InterstitialAd({
  adUnitId: 'ca-app-pub-xxx',
  });

  await interstitial.load();
  await interstitial.show();
},
khlau10 commented 7 months ago

I faced the same issue and it was resolved after adding the following to config.xml

<platform name="android">
    <preference name="GradlePluginKotlinEnabled" value="true" />
</platform>

Reference: https://admob-plus.github.io/docs/cordova/upgrade

AndersonMamede commented 6 months ago

I faced the same issue and it was resolved after adding the following to config.xml

<platform name="android">
    <preference name="GradlePluginKotlinEnabled" value="true" />
</platform>

Reference: https://admob-plus.github.io/docs/cordova/upgrade

I was having the same issue and your solution fixed it! Thank you :tada: