After some research, I get to know that I can place AdMob ads into an application which is having an Android Webivew.
I can able to integrate Banner ads into the apk where the ad is appearing at the bottom as expected.
But once the url loads in the app, I am not able to see the banner.
I'd checked in this link (How to show AdMob banner in inappbrowser using Cordova/Ionic) but It is with AngularJS(1) framework, I am looking for the same with Angular(5).
Any help will be appreciated!
This is good read
Here is a code snippet to show banner and Interstitial Advertisement
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { AdMobFree, AdMobFreeBannerConfig, AdMobFreeInterstitialConfig } from '@ionic-native/admob-free';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(public navCtrl: NavController, public admob: AdMobFree) {
}
showBanner() {
let bannerConfig: AdMobFreeBannerConfig = {
isTesting: true, // Remove in production
autoShow: true
//id: Your Ad Unit ID goes here
};
this.admob.banner.config(bannerConfig);
this.admob.banner.prepare().then(() => {
// success
}).catch(e => console.log(e));
}
launchInterstitial() {
let interstitialConfig: AdMobFreeInterstitialConfig = {
isTesting: true, // Remove in production
autoShow: true
//id: Your Ad Unit ID goes here
};
this.admob.interstitial.config(interstitialConfig);
this.admob.interstitial.prepare().then(() => {
// success
});
}
}