cozycodegh / cordova-plugin-ads

Cordova plugin for adding Google AdMob ads to an app
MIT License
1 stars 3 forks source link

Issue With Banner Size and Position #2

Open MazahirA opened 9 months ago

MazahirA commented 9 months ago

First of all thank you for this easy to use plugin for Cordova users. This plugin is super easy to use, and up to date compared to others in the market. I have an issue with the banner size and position. The banner ads are overlapping with the UI of my app, making the UI unusable. Secondly the width of banner ads are shorter compared to the device I'm using.

Android: 12 Make: Xiaomi Note 12C.

IMG-20231123-WA0007 IMG-20231123-WA0006 IMG-20231123-WA0005

MazahirA commented 9 months ago

Update: It is working as expected when placed on top, but overlapping on bottom.

IMG_20231123_164107

cozycodegh commented 9 months ago

Hi Mazahir,

Thanks, I’m a big fan of the Cordova project.

Yes, the banner at the top creates a view which contains only the ad, while the banner at the bottom creates a view which floats on top of the app.

My solution for this when showing ads at the bottom is to create space with css. You could use css to display an element at the bottom of the screen when ads are enabled. The regular banner is 320x50 and in the css you can set a black background so that it looks like it has its own view too.

MazahirA commented 9 months ago

Hi there,
Thank you for your response, and the tip to adjust it using CSS. Unfortunately I can't do that as I'm displaying the banner ad on a few specific pages. So it will be better if you can update the plugin for banner ads when it's showing in the bottom. It will be better if the banner at the bottom creates a view which contains only the ad, like most of the Cordova Admob plugins do. Thank you

cozycodegh commented 9 months ago

Hi Mazahir,

I updated my Android build and in simulators it is showing up in a regular view at the bottom. I’ll be able to look into it in a few days for devices.

MazahirA commented 9 months ago

Hi, Thank you for that, and I'll be waiting for the final update.

cozycodegh commented 9 months ago

Try updating your android build to at least 34. On my simulators and devices, the bottom view is now added with a black background below the main screen instead of floating on top. Before this, it was the same as in your photos. It should not be overlapping in the latest build!

MazahirA commented 9 months ago

It is still overlapping with the main view. I have updated the build to 34, but no use.

cozycodegh commented 9 months ago

I was able to see the issue today. Now only some of the bottom banner types are overlapping. Only the adMob.ad_sizes.MEDIUM_RECTANGLE and adMob.ad_sizes.LARGE_BANNER, and also adMob.ad_sizes.RESIZE when the screen is small.

I was not able to correct it for those sizes, so we’ve updated the plugin so that the adMob.ad_sizes.RESIZE will not choose those banners that overlap! This should help with the issue that was coming up.

You can update the plugin in your app with 4 commands: https://cozycode.ca/post?pon=cordova-plugin-ads

MazahirA commented 9 months ago

Throwing the below error while building the app;

cannot find symbol com.google.android.ump.UserMessagingPlatform.loadAndShowConsentFormIfRequired( ^ symbol: method loadAndShowConsentFormIfRequired(AdMobPlugin,OnConsentFormDismissedListener) location: class UserMessagingPlatform

cozycodegh commented 9 months ago

Thanks for that. The update is out now.

cozycodegh commented 9 months ago

Hi Mazahir, It still seems unreliable for if it creates a view with the banner on the bottom on Android, I’ve seen the view there and then it disappears after a phone rotate. It does not create this view on iOS. I still haven’t found a solution yet for creating the banner with a separate view reliably.