我设法在一个视图的底部显示了Admob测试横幅,但是现在通过顶部导航栏导航到根视图的后退按钮失败了。
ADmob逻辑是否以某种方式覆盖了ui交互? 这是因为到目前为止,我只展示测试广告吗? 我的实现基于默认示例 https://ionicframework.com/docs/v3/native/admob-free/
以下代码:
import * as moment from 'moment';
import { AdMobFree, AdMobFreeBannerConfig } from '@ionic-native/admob-free';
import { SocialSharing } from '@ionic-native/social-sharing';
import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams, LoadingController, Platform, Slides } from 'ionic-angular';
im
const bannerConfig: AdMobFreeBannerConfig = {
// add your config here
// for the sake of this example we will just use the test config
isTesting: true,
autoShow: true
};
@IonicPage()
@Component({
selector: 'page-forecast',
templateUrl: 'mypage.html',
providers: [AdMobFree]
})
export class ForecastPage {
constructor(public navCtrl: NavController,
public navParams: NavParams,
private _admobFree: AdMobFree) {
this._admobFree.banner.config(bannerConfig);
this._admobFree.banner.prepare()
.then(() => {
console.log('\nSHOWING BANNER!\n');
// banner Ad is ready
// if we set autoShow to false, then we will need to call the show method here
})
.catch(e => console.log(e));
}
ionViewDidLoad() {
console.log('Hello World')
}
}