Which cordova admob plugin version should i use?


#1

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


#2

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


#3

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.


#4

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.


#5

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…


#6

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”