Open xxx44yyy opened 5 years ago
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 :)
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
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>
@xxx44yyy oh! that makes perfect sense. Thank you so much
thank u darkthsideous i ask a question about admob if i use interstitial auto Show =true is it legal for admob . i afraid that i will be banned from admob if i use it !!
@yacinknn sorry for late reply. I dont believe you will get banned i think it only records how many times you use interstitial per impression to avoid spamming. I use autoshow= true, after a certain page in my app loads. i havent had any problems yet
@yacinknn sorry for late reply. I dont believe you will get banned i think it only records how many times you use interstitial per impression to avoid spamming. I use autoshow= true, after a certain page in my app loads. i havent had any problems yet
bro the problem of autoshow = true is showing interstitial ads after every seconds , and this is not allowed in terms of admob ( i have exeperience with this issue ) , can u tell me how to use autoshow= true, after a certain page in ur app loads.? thank u very much bro
Yeah that is definitely not allowed for it to continuously show.
i usually just have my generic launch interstitial function and call it in ionVIewDidLoad
`launchInterstitial() {
let interstitialConfig: AdMobFreeInterstitialConfig = {
autoShow: true,
id: 'ca-app-pub-AD-Mob-ID'
};
this.admob.interstitial.config(interstitialConfig);
this.admob.interstitial.prepare().then(() => {
// success
});
}`
@xxx44yyy i tried your fix same issue occurring for me. Basically my ads are not showing at not a blank banner just completely gone as if it didn't launch at all. however it is launching in my console.log thoughts?
@darkthsideous I think you should create a new issue.
@xxx44yyy ugh that bad. ok i will thank you. Just to confirm what version of the plugin are you using. Also have you tried admob-plus
Anyone found a solution? Man o man I've tried everything from cleaning the cache to removing platforms and reinstalling them, deleting the node modules, deleting plugins folder, re adding all of them. Nothing works!! On real device it does not work and while I test it on DevsApp, it works damn smooth with all the banner and Interstitial ads! Please help
@xxx44yyy please I have done everything but it's still nothing display anything, could it be that I am not getting the javascript code? If yes, please how will the javascript be like and where will I place it? I am using visual studio 2017
@EricChuddy have you seen anymore active issues. Im afraid you might be facing a different issue
To see real advertising - apparently Yes.
When I set isTesing:true; ads is showing in real device.But if I set it false or comment out like // isTesing: true; ads is not showing. Do I Need to Publish It in Play Store? Otherwise ads won't be showing?
@darkthsideous It shows me error when I try to build
@xxx44yyy ads are not shown when i tried to create app with cordova.i even created app with phonegap still it is not working. can u plz help i dont understand whats the problem.if this issue i solved it will be great help from u
If you want to debug your setup for android, this may help:
You will find Java lib source: platforms\android\app\src\main\java\name\ratson\cordova\admob\Admob.java try adding some logs/flags and track them in the logcat logs.
Also: https://stackoverflow.com/questions/45069642/why-remove-admobs-addtestdevice-in-production
Cheers
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?