Skip to main content
Version: Next

Native Ad

Installation

ionic cordova plugin add admob-plus-cordova-native --save

Usage

import { AdMob } from '@admob-plus/ionic/ngx'
import { Component } from '@angular/core'
import { Platform } from '@ionic/angular'

@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
constructor(private platform: Platform, private admob: AdMob) {
this.platform.ready().then(async () => {
const banner = new this.admob.NativeAd({
adUnitId: 'ca-app-pub-xxx/yyy',
})

await ad.load()

await ad.show({
x: 0,
y: 30,
width: window.screen.width,
height: 300,
})
})
}
}