Which cordova admob plugin version should i use?

Hello,

I have an application under meteor 1.4 and im trying to add interstitials add from admob platform. I tried with this plugin which seemed documented for meteor : https://github.com/floatinghotpot/cordova-admob-pro/wiki/06.-How-To-Use-with-Meteor so i used this plugin :

meteor add cordova:cordova-plugin-admobpro@2.20.1

but there seems my admob variable is undefined… Is there anyone who successfully install the admob sdk in meteor that can give me informations on how to do it ?

thanks

Haven’t use admob sdk but cordova plugin related vars need to be declared in mobile-config.json. Read this: https://docs.meteor.com/api/mobile-config.html#App-configurePlugin

1 Like

I’m confused about that, should i add :

App.accessRule('*://googleads.g.doubleclick.net');

or :

App.appendToConfig(`
  <universal-links>
    <host name="localhost:3000" />
  </universal-links>
`);

but the main thing is that i’m still lost in which plugin to use.

the github link that you have provided doesn’t mention any variable declaration. Start with this in mobile-config.json:

App.accessRule("*");

this will allow your app to access all URLs.

1 Like

Thanks now i think i have a progress the console give me now “Received ad” after using this code in my home.js :

Meteor.startup(function () {
  if (Meteor.isCordova) {
    if (AdMob) {
      AdMob.prepareInterstitial( {
        adId: 'ca-app-pub-xxxxxxxxxxxxx~xxxxxxxxxxx',
        autoShow: false,
        success: function() {
          console.log("Received ad");
        },
        error: function() {
          console.log("No ad received");
        }
      });
    } else {
      console.log("No Admob");
    }

  } else {
    console.log("No Cordova ");
  }
});

but now when i try to use AdMob.showInterstitial() in the console i get an “undefined” response…

I haven’t used AdMod before so can’t help you with this. I hope you are using actual AdId instead of “ca-app-pub-xxxxxxxxxxxxx~xxxxxxxxxxx”