Skip to main content
Version: 1.x

Getting Started

@admob-plus/ionic is a wrapper of admob-plus-cordova Cordova plugin providing similar APIs.

It is recommended to first understand how the Cordova plugin works before installing this package.

Installation

Read the Getting Started guide of admob-plus-cordova for how to obtain the Application ID.

Follow the installation guide to add the plugin.

Initialize AdMob SDK

src/app/app.module.ts
import { AdMob } from '@admob-plus/ionic/ngx';
import { NgModule } from '@angular/core';

@NgModule({
providers: [
AdMob,
],
})
export class AppModule {}
src/app/home/home.page.ts
import { AdMob } from '@admob-plus/ionic/ngx';
import { Platform } from '@ionic/angular';

export class HomePage {
constructor(private platform: Platform, private admob: AdMob) {
this.platform.ready().then(async () => {
await this.admob.start();
});
}
}

Display Ads

Following the guide of different ad types to display ads,