Skip to content

06. How To Use with Meteor

katejp edited this page Sep 22, 2015 · 7 revisions

Add plugin: meteor add cordova:[email protected] Replace x.x.x with current version number.

Run the simluator (iOS): meteor run ios

or (Android), meteor run android

Also, make sure that your code is in Meteor.startup(), to ensure that the Cordova plugin is available.

eteor.startup(function () {
  if (Meteor.isCordova) {
    if (AdMob) {
      AdMob.createBanner( {
        adId: 'ca-app-pub-xxx/xxx',
        position: AdMob.AD_POSITION.BOTTOM_CENTER,
        isTesting: true,
        autoShow: true,
        success: function() {
          console.log("Received ad");
        },
        error: function() {
          console.log("No ad received");
        }
      });
    } else {
      console.log("No Admob");
    }
  } else {
    console.log("No Cordova ");
  }
}