Ionic version:
[ ] 2.x
[X] 3.x
[ ] 4.x
I’m submitting a …
[X] bug report
[ ] feature request
Current behavior:
I can’t display banner ads and interstitial are always test ads. Sometimes it just works but after another build it stops working
Expected behavior:
We should be able to display ads with our IDs
Steps to reproduce:
App in pro: https://play.google.com/store/apps/details?id=drodriguez.apps.Words&hl=en
The banner is not being display at top and before playing interstitial is displayed as test ad.
Related code:
import { Injectable } from '@angular/core';
import { AdMobFree, AdMobFreeBannerConfig } from '@ionic-native/admob-free';
@Injectable()
export class AdmobProvider {
constructor(private adMobFree: AdMobFree) {
}
async showBanner() {
try {
const bannerConfig: AdMobFreeBannerConfig = {
id: 'ca-app-pub-2945024608555072/7448431344',
isTesting: false,
autoShow: true,
bannerAtTop: true
};
this.adMobFree.banner.config(bannerConfig);
this.adMobFree.banner.prepare()
.then(() => { })
.catch(e => console.error(e));
}
catch (e) {
console.error(e);
}
}
async showInterstitial() {
try {
const bannerConfig: AdMobFreeBannerConfig = {
id: 'ca-app-pub-2945024608555072/6152521340',
isTesting: false
};
this.adMobFree.interstitial.config(bannerConfig);
this.adMobFree.interstitial.prepare()
.then(() => {
})
.catch(e => console.error(e));
}
catch (e) {
console.error(e);
}
}
async showVideo() {
try {
const bannerConfig: AdMobFreeBannerConfig = {
id: 'ca-app-pub-2945024608555072/7816300482',
isTesting: false
};
this.adMobFree.rewardVideo.config(bannerConfig);
this.adMobFree.rewardVideo.prepare()
.then(() => { })
.catch(e => console.error(e));
}
catch (e) {
console.error(e);
}
}
}
Other information:
Tried also with Admob Pro and getting same issue. Also created issue on Admob Free repo:
https://github.com/ratson/cordova-plugin-admob-free/issues/119.
Also in Ionic repo:
I haven’t tried on iOS.
Ionic info: (run ionic info
from a terminal/cmd prompt and paste output below):
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : android 6.4.0 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v8.9.0
npm : 5.6.0
OS : OS X El Capitan
Xcode : Xcode 8.2 Build version 8C38
Environment Variables:
ANDROID_HOME : /Users/danielrodriguez/Library/Android/sdk/
Misc:
backend : pro