Hello, recently acquire the admob-pro plugin license.
But I already have an application in production where I already used this plugin.
My implementation was as follows, on every page I wanted to display the ad I did the following:
Note: this I do in all the pages where I make the announcement call.
In the example here I use the home.
Come on.
I realize plugin and platform import:
import { AdMobPro } from '@ionic-native/admob-pro';
import { Platform } from 'ionic-angular';
then inside the construct make these settings
constructor(
public navCtrl: NavController,
public navParams: NavParams,
public loadingCtrl: LoadingController,
private toastCtrl: ToastController,
platform: Platform,
private admob: AdMobPro
) {
platform.ready().then(() => {
var admobid = {
licença: "?????????????????????????????????????",
banner: 'ca-app-pub-5884050189104927/9827819257',
interstitial: 'ca-app-pub-5884050189104927/1013482083'
};
this.admob.createBanner({
adId: admobid.banner,
isTesting: false,
autoShow: false,
position: this.admob.AD_POSITION.BOTTOM_CENTER
})
this.admob.prepareInterstitial({
adId: admobid.interstitial,
isTesting: false,
autoShow: true
})
});
}
then logs down when performing a click event I make the announcement block call:
this.admob.showInterstitial();
openView(view) {
this.navCtrl.push(ViewPage, { id: view.videos_id });
this.admob.showInterstitial();
}
and this follows on every page.
Now let’s get down to the problem:
Upon contacting the plugin developer he said the following:
Please set your license key in options first by calling setOptions (), createBanner (), and prepareInterstitial (). You only have to configure it once.
if (AdMob) AdMob.createBanner ({
licença: " sua licença",
adId: "your_ad_unit_id_for_banner_here"
});
he said that, it is not correct. You should not initialize the plug-in on each page.
You need to initialize the plug-in only once.
How do I make the plugin call only once.