I'm having problems integrating with admob by ionic. I built two ads within admob, one banner, and the other is video reward. But I can only display the banner, the functions are exactly identical, but only the banner is loaded. As it is the first time that I am dealing with this type of integration, I would like to know if anyone can help, you already had the same problem.
HTML:
<ion-content padding>
<h6 class="total-premios">Total de Prêmios : R$ 50,00</h6>
<ion-card>
<img src="../../assets/imgs/admob.png"/>
<ion-card-content>
<p class="anuncio-valor">Admob : 0,03</p>
<button ion-button color="primary" (click)="video()">video</button>
<button ion-button color="primary" (click)="banner()">banner</button>
</ion-card-content>
</ion-card>
TS:
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { AdMobFree, AdMobFreeRewardVideoConfig, AdMobFreeBannerConfig } from '@ionic-native/admob-free';
import { Platform } from 'ionic-angular';
@IonicPage()
@Component({
selector: 'page-principal',
templateUrl: 'principal.html',
})
export class PrincipalPage {
constructor(private admob: AdMobFree) { }
video(){
const videoConfig: AdMobFreeRewardVideoConfig = {
id: 'ca-app-pub-8000726989219599/4319074413',
isTesting: true,
autoShow: true
};
this.admob.rewardVideo.config(videoConfig);
this.admob.rewardVideo.prepare()
.then(() => {
this.admob.rewardVideo.show();
console.log("deu certo");
})
.catch((e) =>{
console.log("o erro foi : " +e);
});
}
banner(){
const bannerConfig: AdMobFreeBannerConfig = {
id: 'ca-app-pub-8000726989219599/6127281425',
isTesting: true,
autoShow: true
};
this.admob.banner.config(bannerConfig);
this.admob.banner.prepare()
.then(() => {
this.admob.banner.show();
console.log("o banner deve aparecer aqui");
})
.catch(e => console.log(e));
}
ionViewDidLoad() {
console.log('ionViewDidLoad PrincipalPage');
}
}