ratson / cordova-plugin-admob-free

New development has been moved to "admob-plus-cordova", https://github.com/admob-plus/admob-plus/tree/master/packages/cordova
https://github.com/admob-plus/admob-plus
MIT License
495 stars 211 forks source link

How to add the admob, please advise #313

Open codemasterlike opened 5 years ago

codemasterlike commented 5 years ago

Please help:

  1. Please advise which file the code should be add?
  2. Which is the code to include? If i need the interstitial ads, should i add these code only? admob.interstitial.config({ id: 'ca-app-pub-12346784e/234246', }) admob.interstitial.prepare() admob.interstitial.show()

Can you please share any example, please. Thank you very much,

puneethshetty12 commented 5 years ago

You'll find examples here: https://github.com/ratson/cordova-plugin-admob-free/tree/master/examples

Fearcoder commented 5 years ago
  ionViewDidLoad(){
    const bannerConfig: AdMobFreeBannerConfig = {
      id: '',
      isTesting: true,
      autoShow: true
    };
    this.admob.banner.config(bannerConfig);

    this.admob.banner.prepare()
      .then(() => {
        this.admob.banner.show()
      })
      .catch(e => console.log(e));
  }

Hope it helps