Homepage.ts
//all imports
async ionViewWillEnter() {
this.init();
// this.zone.run(async () => {
this.InterDish = await AdMob.addListener(InterstitialAdPluginEvents.Dismissed, () => {
console.log("Interstitial Dismissed");
this.nextpage();
});
this.InterLoadFailh = await AdMob.addListener(InterstitialAdPluginEvents.FailedToShow, () => {
console.log("Iterstitial FailedToShow");
this.nextpage();
});
// });
}
ionViewWillLeave() {
this.InterDish.remove();
this.InterLoadFailh.remove();
}
nextpage.html
<ion-segment [(ngModel)]="Design" (ionChange)="segmentChanged($event)">
<ion-segment-button value="new">
new
</ion-segment-button>
<ion-segment-button value="old">
old
</ion-segment-button>
<ion-segment-button value="other">
Other
</ion-segment-button>
</ion-segment>
当广告显示,如果我关闭广告,并在“下一页”段没有改变,如果我添加写这个this.cdr.detectChanges();
代码,那么只有它检测到变化,如果广告不显示,那么它工作正常。
1条答案
按热度按时间a11xaf1n1#
使用
ngZone