Hello everyone
I want to add admob to my app and I tried with adding cordova-plugin-admob the plugin gets installed OK and I added the following code for admob in app.js
From documentation seems that createBannerView require publisherId and not adId (used instead in createBanner function). Probably you must also specify banner position. Check the documentation and try againā¦
I tried from given url only, but the plugin used is updated and some parts are changed and i couldnt found any answer for this in the blog post comment section. for ex: instead of windows.plugins.AdMob the new plugin is called as windows.AdMob i am putting my full code below for your reference. i am not getting any errors but also no adds or even white space on ad position
First make sure youāre doing this inside of a deviceReady block.
Second, see if you could console.log out window.AdMob. Letās make sure itās something there that you can use.
i am doing inside device ready block but when i use ionic serve and in javascript lof i see undefined for console.log out window.AdMob. as well as console.log out window.pluginsAdMob.
but from device if i alert if (window.AdMob) { alert('text');} its working fine
Everything seems to be perfectly alright with the code. I had similar issues when I first used this plugin. But later learnt that we need to use āBanner Ad Unit IDā in place of adId and not āInterstitial Ad Unit IDā.
Go to AdMob and create banner ad unit and replace the adId with the banner ad unit id. And it must start working.