cordova-plugin-admob-free
cordova-plugin-admob-free copied to clipboard
Not showing in real device
After run example app (https://github.com/ratson/cordova-plugin-admob-free/tree/master/examples) on real device, ads not showing. isTesting: true and autoShow: true included.
Is that right?
Same case for me, real ads not showing in device, please somebody tell me why?
did according to the instructions? https://developers.google.com/admob/android/quick-start
Yes, Real Ads showing on ionic DevApp but not in production apk.(emulator or real devices)
Emulator show production and test ads. Real device does not show anything.
@Winamp9 What can help guide for Android? We are trying to use Cordova :)
We can try this: https://stackoverflow.com/questions/52142760/the-banner-not-showing-with-my-id-from-admob-ionic-3
Is this worked for you? And have you publish your app to play store? @xxx44yyy
I can't find a solution to the problem, so I'll probably try to publish the app. But not today, maybe tomorrow.
I haven't play store account yet. may be that should work. Please let me know if you find any solution, (same for me also)
Yeah, okay. I will still look for a solution and if I do not find it, I will have to try to publish it.
@ConcaveIT It worked. I added this to the configuration:
"cordova-admob-sdk": "0.20.0"
and this
<plugin name="cordova-admob-sdk" spec="../plugins/cordova-admob-sdk">
<variable name="PLAY_SERVICES_VERSION" value="+" />
</plugin>
After that, a banner (test ads) appeared on the real phone.

Then, I published the application and it appeared real advertising (of course, the code has already turned off the parameter isTesting). https://play.google.com/store/apps/details?id=com.a2_finance.cordova.test.ads I think Google will swear that I published such an application, so I will delete it today.
You can download the APK (https://apkpure.com/ru/cordova-ads-test/com.a2_finance.cordova.test.ads), and decompile it.
@xxx44yyy Thanks mate. So… is it required to publish the app to play store?
To see real advertising - apparently Yes.
"cordova-admob-sdk": "0.20.0"
where i can add this ? "cordova-admob-sdk": "0.20.0"
@yacinknn,,, you have to add that in config.xml
bro thank u it worked for me but i have 2 questions : 1-the banner ads display But not always ( Only sometimes ) why ? 2- i want to display interstitial ads but automaticaly ( like in plugin of admobpro ) how can i do it? thank u very much
@Yacinknn, can you share your code?
@yacinknn
- it's normal if ads real (not test)
admob.interstitial.config({
id: admobid.interstitial,
// isTesting: true,
autoShow: true,
});
i use same code 👍 var admobid = {} if (/(android)/i.test(navigator.userAgent)) { // for android & amazon-fireos admobid = { banner: 'ca-app-pub-3940256099942544/6300978111', interstitial: 'ca-app-pub-3940256099942544/1033173712', } } else if (/(ipod|iphone|ipad)/i.test(navigator.userAgent)) { // for ios admobid = { banner: 'ca-app-pub-3940256099942544/2934735716', interstitial: 'ca-app-pub-3940256099942544/4411468910', } }
document.addEventListener('deviceready', function() { admob.banner.config({ id: admobid.banner, isTesting: true, autoShow: true, }) admob.banner.prepare()
admob.interstitial.config({ id: admobid.interstitial, isTesting: true, autoShow: false, }) admob.interstitial.prepare()
document.getElementById('showAd').disabled = true document.getElementById('showAd').onclick = function() { admob.interstitial.show() }
}, false)
document.addEventListener('admob.banner.events.LOAD_FAIL', function(event) { console.log(event) })
document.addEventListener('admob.interstitial.events.LOAD_FAIL', function(event) { console.log(event) })
document.addEventListener('admob.interstitial.events.LOAD', function(event) { console.log(event) document.getElementById('showAd').disabled = false })
document.addEventListener('admob.interstitial.events.CLOSE', function(event) { console.log(event)
admob.interstitial.prepare() })
If you use autoShow : false then you have to call it on. .then Other wise use true
it worked for me , if i use the value of autoShow =true ? is it ok?
Confusion about one thing some apps does not belongs to play store but they shows real admob ad. How?
@ConcaveIT They're probably using test IDs. https://developers.google.com/admob/android/test-ads
@xxx44yyy, No, because they do clicking business. Other thing, you can check removing apps from play store, and see what happens.
@ConcaveIT To create an ad unit in Admob, you need an ID from GooglePlay. Therefore, I think if you remove the application from GooglePlay, then nothing will change, because in Admob the application will be registered.
But it doesn't matter now. The important thing is that: a) test ads is shown (on emulator - Yes, on real device - Yes) b) real ads is shown (on emulator - No, on real device - Yes, after publication in Google Play)
But interesting thing is, if you run your app in ionic DevApp then real ads shows. Even when app is not in play store.
I don't know..
What info do I get from you? Here I am using and running all ad methods.
By the tests I've done so far, in the emulator only test ads same. In the actual device everything okay, they exhibit all without problems. Try to use something like:
ionic cordova run android --prod
Hello @yacinknn @xxx44yyy you guys are life savers thank you. I was wondering where in config.xml you add "cordova-admob-sdk": "0.20.0" in the
@darkthsideous not config.xml. In package.json. It's mine:
{
"name": "cordovaads",
"displayName": "CordovaAds",
"version": "1.0.0",
"description": "A sample cordova app for testing ads.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"cordova-admob-sdk": "0.20.0",
"cordova-android": "^7.1.1",
"cordova-browser": "^5.0.4",
"cordova-ios": "^4.5.5",
"cordova-plugin-admob-free": "^0.21.0",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-promise-polyfill": "0.0.2"
},
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-admob-free": {
"ADMOB_APP_ID": "ca-app-pub-XXXXXXXXXXX~YYYYYYYYYYY"
}
},
"platforms": [
"ios",
"android",
"browser"
]
}
}
And config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.xxxx.yyyy.package.app" version="1.0.0" xmlns="http://www.w3.org/ns/widgets">
<name>CordovaAds</name>
<description>A sample cordova app for testing ads.</description>
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<plugin name="cordova-plugin-admob-free" spec="0.21.0">
<variable name="ADMOB_APP_ID" value="ca-app-pub-XXXXXXXXX~YYYYYYYYY" />
</plugin>
<plugin name="cordova-admob-sdk" spec="../plugins/cordova-admob-sdk">
<variable name="PLAY_SERVICES_VERSION" value="+" />
</plugin>
<preference name="fullscreen" value="true" />
<preference name="show-splash-screen-spinner" value="false" />
<engine name="ios" spec="^4.5.5" />
<engine name="android" spec="^7.1.1" />
<engine name="browser" spec="^5.0.4" />
</widget>