Open Serizao opened 7 years ago
please look at https://github.com/ratson/cordova-plugin-admob-free/blob/master/src/android/AdMobConfig.java#L228-L248
Please set your id always.
@wleberre Is your app running on real device?
yes it is the only for ads working is to set directly id in this : https://github.com/ratson/cordova-plugin-admob-free/blob/master/src/ios/CDVAdMob.m#L50L52
@wleberre Would you let me know what is the value of console.log(admob.interstitial._config)
just before your are calling admob.interstitial.prepare()
?
it do an error :
Property '_config' does not exist on type 'AdMobFreeInterstitial'.
L89: console.log(admob.interstitial._config)
L90: admob.interstitial.prepare()
[15:20:03] ionic-app-script task: "build"
[15:20:03] Error: Failed to transpile program
Error: Failed to transpile program
at BuildError.Error (native)
at new BuildError (/Users/william/Desktop/popote/popote/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
at /Users/william/Desktop/popote/popote/node_modules/@ionic/app-scripts/dist/transpile.js:137:20
at transpileWorker (/Users/william/Desktop/popote/popote/node_modules/@ionic/app-scripts/dist/transpile.js:103:12)
at Object.transpile (/Users/william/Desktop/popote/popote/node_modules/@ionic/app-scripts/dist/transpile.js:61:12)
at buildProject (/Users/william/Desktop/popote/popote/node_modules/@ionic/app-scripts/dist/build.js:97:78)
at /Users/william/Desktop/popote/popote/node_modules/@ionic/app-scripts/dist/build.js:47:16
@ratson I put directly console.log in admobjs (https://github.com/ratson/cordova-plugin-admob-free/blob/master/src/js/interstitial.js#L55L56) for see options result :
{"interstitialAdId":"ca-app-pub-MY-ID","isTesting":false,"autoShow":true}
I'll check it soon.
@wleberre Is your printed result before or after delete options.id
? If it is after, that is what I was expecting, is the above all your ad calls?
it return : undefined
if i running ionic cordova run android, are showing real adds, but if i run ionic cordova run android --prepare - are showing only test ads any suggestions?
Hi wleberre,
I've got the same problem. Test ads are always showing, even when I've built and signed a release APK.
My ad config is as bellow:
const bannerConfig: AdMobFreeBannerConfig = {
// add your config here
// for the sake of this example we will just use the test config
autoShow: true,
id: credentials.androidBanner
};
Did you solve this?
You test it on android emulator? If yes that's normal But me i don't arrive to resolve this . And you put your admob id in AdMobFreeBannerConfig ?
When testing on an emulator/ debug APK I get the test ads, thats okay.
I've built and signed my app for release and am testing on a device but still get the test ads.
what say the log about it ?
There's nothing in the log, presumably because there is no error/ warning so nothing to log. AdMob things it's doing what it should be?
Do you use android studio for see log of app while it running
No I'm running the app with ionic cordova run android -lcs
. I'm also trying this building the app for release, signing, and installing like a regular app.
can you try with ionic cordova emulate android
and android studio i think it log more event than ionic
But emulating will show the test adverts, which isn't a problem. My problem is that test adverts are shown in a release app.
Try this:
var admobid = {
banner: 'YOUR BANNER ID',
interstitial: 'YOUR INTERSTITIAL ID',
}
document.addEventListener('deviceready', function() {
admob.banner.config({
id: admobid.banner,
isTesting: false,
autoShow: true,
})
admob.banner.prepare()
admob.interstitial.config({
id: admobid.interstitial,
isTesting: false,
autoShow: true,
})
admob.interstitial.prepare()
}, false)
showBanner() { let bannerConfig: AdMobFreeBannerConfig = { isTesting: false, autoShow: true, id: 'ca-app-pub-ID' };
this.admob.banner.config(bannerConfig); this.admob.banner.prepare().then(() => { }).catch(e => console.log(e));
Same here, only test mode.
not sure if I was having the same issue as you guys are having, but it seems if you try to inject admobFree
into multiple view models in ionic 2, you need to make sure none of them have isTesting
set to true in config object. i forgot to remove that in one of the view models and was seeing test ads in my published app too. also it could have something to do with that it takes a bit for actual live ads to start rendering, it depends on the available for your location and device ads content.
What is the solution for this? I am also stuck with the same issue. This is my code
configBanner : function(){
admob.setOptions({
publisherId : 'MY PUB ID',
});
admob.banner.config({
id: admobid.banner,
publisherId : 'MY PUB ID',
isTesting : false,
overlap : true,
size : 'BANNER'
});
// Create banner
admob.banner.prepare();
},
My plugin lists
cordova-admob-sdk 0.18.0 "AdMob SDK"
cordova-plugin-admob-free 0.18.0 "Cordova AdMob Plugin"
cordova-plugin-admob-mediation-inmobi 1.0.0 "AdMob Mediation Adapter for InMobi"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-socialsharing 5.4.1 "SocialSharing"
cordova-plugin-x-toast 2.6.2 "Toast"
cordova-promise-polyfill 0.0.2 "cordova-promise-polyfill"
es6-promise-plugin 4.2.2 "Promise"
Any update on this? It's been several months now. Any of you managed to get this to work properly?
it still happen.....everyone has this problem?
same issue
now I am using another plugin because this one never worked for me
What did you end up using ?
I am using AdMob Plus https://admob-plus.github.io/docs/
Hello,
I try to use the free admob plugin but it always show testing ads this is my code :
do you now why the plugin do this ?