Hey EYALIN and RATSON!! Please help me out!!! Can't get the plugin work... what am I doing wrong?! Please don't tell me, that I have to add the "let banner" snippet into the MainActivity file... I added it into the headers of the assets/html files... ...ended here: Argh! It's not working... what am I doing wrong? This is the situation: - made my webproject in html-css-javascript
- build the corona project and added all components: the admob-plus plugin and androidx adapters
- imported the android folder in Android Studio, synced and added the necessary meta.data in manifest.xml
- implemented the abdmob code in MainActivity.java and checked gradle.build for actual google ads lib
- added the let banner snippets to the html headers in assets
let bannerdocument.addEventListener('deviceready', async () => {banner = new admob.BannerAd({adUnitId: 'ca-app-pub-xxx/yyy',})banner.on('impression', async (evt) => {await banner.hide()})await banner.show()}, false)
Result: the banner is jumping in and out and stays after an amount of time (at least, if you revisit the page again). If I change the code in let bannerdocument.addEventListener('deviceready', async () => {banner = new admob.BannerAd({adUnitId: 'ca-app-pub-xxx/yyy',})banner.on('impression', async (evt) => {await banner.hide()})await banner.show()}, true)
...the banner is showing up and stays. BUT... this works fine as long as the user opens the pages in a linear way. If he revisits the page - the same banner duplicates itself and jump over the old one: now we see two identical banners at the bottom. This goes on and on... till the whole page is covered with the same banner. Hey guys, how do you manage it to work? Did I forget to add code somewhere? Please help. I need really help. Found this and placed it into header of the html where the banner should appearing but it isn't working https://github.com/admob-plus/admob-plus/issues/450 function initBanner(id) { let banner = new admob.BannerAd({ adUnitId: 'ca-app-pub-xxxxxxxx' , position: 'bottom', npa: status, id: id ? Number.parseInt(id) : null }); banner.on('load', (ex) => { localStorage.setItem('lastBannerId', ex.adId); }) return banner.show();}const lastBannerId = localStorage.getItem('lastBannerId');await initBanner(lastBannerId) .catch(ex => { initBanner(null) });
|