Hi,
I’m ionic new. I added adMobFree to my app. But the ads are not showing. And test ads don’t show up.
I only see black stripe when run as test. Where am i making a mistake?
Thank you.
package.json;
{
"name": "App",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"start": "ionic-app-scripts serve",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint"
},
"dependencies": {
"@angular/animations": "5.2.11",
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/forms": "5.2.11",
"@angular/http": "5.2.11",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/admob-free": "^4.20.0",
"@ionic-native/core": "~4.20.0",
"@ionic-native/splash-screen": "~4.20.0",
"@ionic-native/status-bar": "~4.20.0",
"@ionic/storage": "2.2.0",
"cordova-admob-sdk": "0.13.1",
"cordova-android": "7.1.4",
"cordova-browser": "^6.0.0",
"cordova-plugin-admob-free": "^0.21.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.1.3",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-promise-polyfill": "0.0.2",
"ionic-angular": "3.9.5",
"ionicons": "3.0.0",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.29"
},
"devDependencies": {
"@ionic/app-scripts": "3.2.2",
"typescript": "~2.6.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-admob-free": {
"ADMOB_APP_ID": "ca-app-pub-8060783268745607~9587423592"
},
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-ionic-keyboard": {},
"cordova-admob-sdk": {
"PLAY_SERVICES_VERSION": "11.6.0"
}
},
"platforms": [
"android",
"browser"
]
}
}
I added the following codes to the config.xml file ;
<plugin name="cordova-plugin-admob-free" spec="0.21.0">
<variable name="ADMOB_APP_ID" value="ca-app-pub-8060783268745607~9587423592" />
</plugin>
<plugin name="cordova-admob-sdk" spec="0.13.1">
<variable name="PLAY_SERVICES_VERSION" value="11.6.0" />
</plugin>
this is my banner code ;
showBanner() {
this.platform
.ready()
.then(() => {
const bannerConfig: AdMobFreeBannerConfig = {
id: this.bannerId,
isTesting: true,
//bannerAtTop: true
//autoShow: true
};
this.admobFree.banner.config(bannerConfig);
this.admobFree.banner.prepare().then(() => {
this.admobFree.banner.show();
})
.catch(e => console.log(e));
})
.catch(e => console.log(e));
}