AdMob Pro

Contents

Plugin for Google Ads, including AdMob / DFP (DoubleClick for publisher) and mediations to other Ad networks.

https://github.com/floatinghotpot/cordova-admob-pro

Installation

ionic cordova plugin add cordova-plugin-admobpro npm install @ionic-native/admob-pro

Supported Platforms

  • Android
  • iOS
  • Windows Phone 8

Usage

import { AdMobPro } from '@ionic-native/admob-pro';
import { Platform } from 'ionic-angular';

constructor(private admob: AdMobPro, private platform: Platform ) { }

ionViewDidLoad() {
  this.admob.onAdDismiss()
    .subscribe(() => { console.log('User dismissed ad'); });
}

onClick() {
  let adId;
  if(this.platform.is('android')) {
    adId = 'YOUR_ADID_ANDROID';
  } else if (this.platform.is('ios')) {
    adId = 'YOUR_ADID_IOS';
  }
  this.admob.prepareInterstitial({adId: adId})
    .then(() => { this.admob.showInterstitial(); });
}